2021-09-06 10:47:11 -07:00
|
|
|
image: node:14
|
2020-04-14 11:07:40 -07:00
|
|
|
|
|
|
|
variables:
|
|
|
|
NODE_ENV: test
|
|
|
|
|
2020-04-14 16:00:02 -07:00
|
|
|
cache:
|
2021-08-23 12:36:14 -07:00
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- yarn.lock
|
|
|
|
paths:
|
|
|
|
- node_modules
|
2020-04-14 16:00:02 -07:00
|
|
|
|
2020-04-14 11:07:40 -07:00
|
|
|
stages:
|
|
|
|
- lint
|
|
|
|
- test
|
2020-04-14 16:00:02 -07:00
|
|
|
- build
|
2020-08-30 11:59:39 -07:00
|
|
|
- deploy
|
2020-04-14 11:07:40 -07:00
|
|
|
|
|
|
|
before_script:
|
2021-09-02 14:57:40 -07:00
|
|
|
- env
|
2020-04-14 11:07:40 -07:00
|
|
|
- yarn
|
|
|
|
|
|
|
|
lint-js:
|
|
|
|
stage: lint
|
2022-04-04 08:50:14 -07:00
|
|
|
script: yarn lint:js
|
2021-08-22 14:17:31 -07:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.js"
|
2022-03-18 13:36:15 -07:00
|
|
|
- "**/*.jsx"
|
|
|
|
- "**/*.ts"
|
|
|
|
- "**/*.tsx"
|
2021-08-22 14:17:31 -07:00
|
|
|
- ".eslintignore"
|
|
|
|
- ".eslintrc.js"
|
2020-04-14 11:07:40 -07:00
|
|
|
|
|
|
|
lint-sass:
|
|
|
|
stage: lint
|
2022-04-04 08:50:14 -07:00
|
|
|
script: yarn lint:sass
|
2021-08-22 14:17:31 -07:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.scss"
|
|
|
|
- "**/*.css"
|
|
|
|
- ".stylelintrc.json"
|
2020-04-14 11:07:40 -07:00
|
|
|
|
2020-04-14 16:00:02 -07:00
|
|
|
jest:
|
|
|
|
stage: test
|
2022-04-04 08:50:14 -07:00
|
|
|
script: yarn test:coverage
|
2021-08-22 14:17:31 -07:00
|
|
|
only:
|
|
|
|
changes:
|
|
|
|
- "**/*.js"
|
|
|
|
- "**/*.json"
|
|
|
|
- "app/soapbox/**/*"
|
|
|
|
- "webpack/**/*"
|
|
|
|
- "jest.config.js"
|
|
|
|
- "package.json"
|
|
|
|
- "yarn.lock"
|
2020-04-14 11:16:08 -07:00
|
|
|
|
2020-04-14 11:20:07 -07:00
|
|
|
build-production:
|
|
|
|
stage: build
|
2020-04-26 10:49:20 -07:00
|
|
|
script: yarn build
|
2020-04-14 11:20:07 -07:00
|
|
|
variables:
|
|
|
|
NODE_ENV: production
|
2020-04-14 11:07:40 -07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-04-26 12:41:04 -07:00
|
|
|
- static
|
2020-04-14 11:07:40 -07:00
|
|
|
|
2020-08-30 11:59:39 -07:00
|
|
|
docs-deploy:
|
|
|
|
stage: deploy
|
|
|
|
image: alpine:latest
|
2020-08-29 14:51:17 -07:00
|
|
|
before_script:
|
|
|
|
- apk add curl
|
|
|
|
script:
|
2020-08-30 11:49:42 -07:00
|
|
|
- curl -X POST -F"token=$CI_JOB_TOKEN" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline
|
2020-08-29 11:18:51 -07:00
|
|
|
only:
|
2021-08-22 14:17:31 -07:00
|
|
|
refs:
|
|
|
|
- develop
|
|
|
|
changes:
|
|
|
|
- "docs/**/*"
|
2020-08-29 11:18:51 -07:00
|
|
|
|
2020-06-11 23:02:18 -07: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-21 21:48:29 -07:00
|
|
|
|
|
|
|
pages:
|
|
|
|
stage: deploy
|
2021-09-06 21:59:19 -07:00
|
|
|
before_script: []
|
2021-08-21 21:48:29 -07:00
|
|
|
script:
|
2021-09-06 21:59:19 -07:00
|
|
|
# artifacts are kept between jobs
|
2021-09-06 20:48:42 -07:00
|
|
|
- mv static public
|
2021-09-06 21:56:29 -07:00
|
|
|
variables:
|
|
|
|
NODE_ENV: production
|
2021-08-21 21:48:29 -07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
only:
|
2021-08-22 14:17:31 -07:00
|
|
|
refs:
|
|
|
|
- develop
|