2024-10-19 19:16:43 +00:00
|
|
|
image: node:22
|
2020-04-14 18:07:40 +00:00
|
|
|
|
2022-12-30 17:39:08 +00:00
|
|
|
default:
|
|
|
|
interruptible: true
|
|
|
|
|
2020-04-14 18:07:40 +00:00
|
|
|
stages:
|
2024-10-19 19:16:43 +00:00
|
|
|
- build
|
2020-08-30 18:59:39 +00:00
|
|
|
- deploy
|
2020-04-14 18:07:40 +00:00
|
|
|
|
2023-09-18 16:27:19 +00:00
|
|
|
build:
|
2024-10-19 19:16:43 +00:00
|
|
|
stage: build
|
2023-09-18 18:06:54 +00:00
|
|
|
before_script:
|
2024-10-19 19:16:43 +00:00
|
|
|
- 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:
|
2024-10-19 19:16:43 +00:00
|
|
|
- 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
|
2023-09-18 16:27:19 +00:00
|
|
|
- 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
|
2023-09-18 16:27:19 +00:00
|
|
|
- npx -y surge dist $CI_COMMIT_REF_SLUG.git.soapbox.pub
|
2022-05-25 15:23:55 +00:00
|
|
|
allow_failure: true
|
2024-10-19 19:16:43 +00:00
|
|
|
when: manual
|
2022-05-19 02:48:16 +00:00
|
|
|
|
2021-08-22 04:48:29 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2023-09-18 18:30:55 +00:00
|
|
|
before_script:
|
|
|
|
- apt-get update -y && apt-get install -y unzip
|
2021-08-22 04:48:29 +00:00
|
|
|
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
|
2021-09-07 04:56:29 +00:00
|
|
|
variables:
|
|
|
|
NODE_ENV: production
|
2021-08-22 04:48:29 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
only:
|
2023-01-01 02:50:05 +00:00
|
|
|
variables:
|
2024-10-19 19:16:43 +00:00
|
|
|
- $CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME
|