soapbox/.gitlab-ci.yml

103 wiersze
1.6 KiB
YAML
Czysty Zwykły widok Historia

2020-04-14 18:07:40 +00:00
image: node:12
variables:
NODE_ENV: test
2020-04-14 23:00:02 +00:00
cache:
- key:
files:
- yarn.lock
paths:
- node_modules
- key: $CI_COMMIT_REF_NAME
paths:
- static
2020-04-14 23:00:02 +00:00
2020-04-14 18:07:40 +00:00
stages:
- lint
- test
2020-04-14 23:00:02 +00:00
- build
2020-08-30 18:59:39 +00:00
- deploy
2020-04-14 18:07:40 +00:00
before_script:
- yarn
lint-js:
stage: lint
script: yarn test:lint:js
only:
changes:
- "**/*.js"
- ".eslintignore"
- ".eslintrc.js"
2020-04-14 18:07:40 +00:00
lint-sass:
stage: lint
script: yarn test:lint:sass
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
script: yarn test:jest
only:
changes:
- "**/*.js"
- "**/*.json"
- "app/soapbox/**/*"
- "webpack/**/*"
- "jest.config.js"
- "package.json"
- "yarn.lock"
2020-04-14 18:16:08 +00:00
2020-04-14 18:20:07 +00:00
build-production:
stage: build
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:
- 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:
- 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:
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
pages:
stage: deploy
before_script: []
script:
- mv static public
2021-08-22 20:44:49 +00:00
- cp public/{index.html,404.html}
variables:
NODE_ENV: production
artifacts:
paths:
- public
only:
refs:
- develop