soapbox/.gitlab-ci.yml

52 lines
1.1 KiB
YAML
Raw Normal View History

image: node:22
2020-04-14 18:07:40 +00:00
default:
interruptible: true
2020-04-14 18:07:40 +00:00
stages:
- build
2020-08-30 18:59:39 +00:00
- deploy
2020-04-14 18:07:40 +00:00
build:
stage: build
2023-09-18 18:06:54 +00:00
before_script:
- yarn install --ignore-scripts
2023-09-18 18:06:54 +00:00
- apt-get update -y && apt-get install -y zip
2022-12-29 06:17:29 +00:00
script:
- yarn lint
- yarn i18n && git diff --quiet || (echo "Locale files are out of date. Please run `yarn i18n`" && exit 1)
- NODE_ENV=production yarn build
- cp dist/index.html dist/404.html
2023-09-18 17:54:21 +00:00
- cd dist && zip -r ../soapbox.zip . && cd ..
2020-04-14 18:07:40 +00:00
artifacts:
paths:
2023-09-18 17:54:21 +00:00
- soapbox.zip
2020-04-14 18:07:40 +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
2023-09-18 18:30:55 +00:00
before_script:
- apt-get update -y && apt-get install -y unzip
2022-05-19 02:48:16 +00:00
script:
2023-09-18 18:38:32 +00:00
- unzip soapbox.zip -d dist
- npx -y surge dist $CI_COMMIT_REF_SLUG.git.soapbox.pub
2022-05-25 15:23:55 +00:00
allow_failure: true
when: manual
2022-05-19 02:48:16 +00:00
pages:
stage: deploy
2023-09-18 18:30:55 +00:00
before_script:
- apt-get update -y && apt-get install -y unzip
script:
2021-09-07 04:59:19 +00:00
# artifacts are kept between jobs
2023-09-18 18:38:32 +00:00
- unzip soapbox.zip -d public
variables:
NODE_ENV: production
artifacts:
paths:
- public
only:
2023-01-01 02:50:05 +00:00
variables:
- $CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME