2022-06-01 18:22:49 +00:00
|
|
|
image: node:18
|
2020-04-14 18:07:40 +00:00
|
|
|
|
|
|
|
variables:
|
|
|
|
NODE_ENV: test
|
|
|
|
|
2020-04-14 23:00:02 +00:00
|
|
|
cache:
|
2021-08-23 19:36:14 +00:00
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- yarn.lock
|
|
|
|
paths:
|
2022-05-17 11:39:59 +00:00
|
|
|
- node_modules/
|
2020-04-14 23:00:02 +00:00
|
|
|
|
2020-04-14 18:07:40 +00:00
|
|
|
stages:
|
2022-05-25 15:00:28 +00:00
|
|
|
- deps
|
2020-04-14 18:07:40 +00:00
|
|
|
- test
|
2020-08-30 18:59:39 +00:00
|
|
|
- deploy
|
2020-04-14 18:07:40 +00:00
|
|
|
|
2022-05-25 15:00:28 +00:00
|
|
|
deps:
|
|
|
|
stage: deps
|
|
|
|
script: yarn install --ignore-scripts
|
2022-05-25 19:36:30 +00:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- yarn.lock
|
2020-04-14 18:07:40 +00:00
|
|
|
|
|
|
|
lint-js:
|
2022-05-25 14:58:19 +00:00
|
|
|
stage: test
|
2022-04-04 15:50:14 +00:00
|
|
|
script: yarn lint:js
|
2021-08-22 21:17:31 +00:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.js"
|
2022-03-18 20:36:15 +00:00
|
|
|
- "**/*.jsx"
|
|
|
|
- "**/*.ts"
|
|
|
|
- "**/*.tsx"
|
2021-08-22 21:17:31 +00:00
|
|
|
- ".eslintignore"
|
|
|
|
- ".eslintrc.js"
|
2020-04-14 18:07:40 +00:00
|
|
|
|
|
|
|
lint-sass:
|
2022-05-25 14:58:19 +00:00
|
|
|
stage: test
|
2022-04-04 15:50:14 +00:00
|
|
|
script: yarn lint:sass
|
2021-08-22 21:17:31 +00:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.scss"
|
|
|
|
- "**/*.css"
|
|
|
|
- ".stylelintrc.json"
|
2020-04-14 18:07:40 +00:00
|
|
|
|
2020-04-14 23:00:02 +00:00
|
|
|
jest:
|
|
|
|
stage: test
|
2022-04-04 15:50:14 +00:00
|
|
|
script: yarn test:coverage
|
2021-08-22 21:17:31 +00:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.js"
|
|
|
|
- "**/*.json"
|
|
|
|
- "app/soapbox/**/*"
|
|
|
|
- "webpack/**/*"
|
2022-05-25 19:36:30 +00:00
|
|
|
- "custom/**/*"
|
2021-08-22 21:17:31 +00:00
|
|
|
- "jest.config.js"
|
|
|
|
- "package.json"
|
|
|
|
- "yarn.lock"
|
2022-05-27 13:30:51 +00:00
|
|
|
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
|
2020-04-14 18:16:08 +00:00
|
|
|
|
2022-05-20 23:47:49 +00:00
|
|
|
nginx-test:
|
|
|
|
stage: test
|
|
|
|
image: nginx:latest
|
|
|
|
before_script: cp installation/mastodon.conf /etc/nginx/conf.d/default.conf
|
|
|
|
script: nginx -t
|
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "installation/mastodon.conf"
|
|
|
|
|
2020-04-14 18:20:07 +00:00
|
|
|
build-production:
|
2022-05-25 15:15:41 +00:00
|
|
|
stage: test
|
2020-04-26 17:49:20 +00:00
|
|
|
script: yarn build
|
2020-04-14 18:20:07 +00:00
|
|
|
variables:
|
|
|
|
NODE_ENV: production
|
2020-04-14 18:07:40 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-05-25 15:15:41 +00:00
|
|
|
- static
|
2020-04-14 18:07:40 +00:00
|
|
|
|
2020-08-30 18:59:39 +00:00
|
|
|
docs-deploy:
|
|
|
|
stage: deploy
|
|
|
|
image: alpine:latest
|
2020-08-29 21:51:17 +00:00
|
|
|
before_script:
|
|
|
|
- apk add curl
|
|
|
|
script:
|
2020-08-30 18:49:42 +00:00
|
|
|
- curl -X POST -F"token=$CI_JOB_TOKEN" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline
|
2020-08-29 18:18:51 +00:00
|
|
|
only:
|
2021-08-22 21:17:31 +00:00
|
|
|
refs:
|
|
|
|
- develop
|
|
|
|
changes:
|
|
|
|
- "docs/**/*"
|
2020-08-29 18:18:51 +00:00
|
|
|
|
2020-06-12 06:02:18 +00:00
|
|
|
# Supposed to fail when translations are outdated, instead always passes
|
|
|
|
#
|
|
|
|
# i18n:
|
|
|
|
# stage: build
|
|
|
|
# script: yarn manage:translations
|
|
|
|
# variables:
|
|
|
|
# NODE_ENV: development
|
|
|
|
# before_script:
|
|
|
|
# - yarn
|
|
|
|
# - yarn build
|
2021-08-22 04:48:29 +00:00
|
|
|
|
2022-05-19 02:48:16 +00:00
|
|
|
review:
|
|
|
|
stage: deploy
|
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
|
|
url: https://$CI_COMMIT_REF_SLUG.git.soapbox.pub
|
|
|
|
script:
|
|
|
|
- npx -y surge static $CI_COMMIT_REF_SLUG.git.soapbox.pub
|
2022-05-25 15:23:55 +00:00
|
|
|
allow_failure: true
|
2022-05-19 02:48:16 +00:00
|
|
|
|
2021-08-22 04:48:29 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2021-09-07 04:59:19 +00:00
|
|
|
before_script: []
|
2021-08-22 04:48:29 +00:00
|
|
|
script:
|
2021-09-07 04:59:19 +00:00
|
|
|
# artifacts are kept between jobs
|
2021-09-07 03:48:42 +00:00
|
|
|
- mv static public
|
2021-09-07 04:56:29 +00:00
|
|
|
variables:
|
|
|
|
NODE_ENV: production
|
2021-08-22 04:48:29 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
only:
|
2021-08-22 21:17:31 +00:00
|
|
|
refs:
|
|
|
|
- develop
|