Created
September 5, 2022 23:44
-
-
Save thstarshine/7f4eec7f4634ba9fa7894ba8fb1a36a2 to your computer and use it in GitHub Desktop.
ci test file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:16 | |
cache: | |
key: "$CI_PROJECT_ID" | |
paths: | |
- node_modules/ | |
before_script: | |
- npm set progress=false | |
building: | |
stage: build | |
variables: | |
NODE_ENV: "development" | |
script: | |
- npm i --no-optional | |
- npm run build | |
type: build | |
tags: | |
- npm | |
- node | |
only: | |
- tags | |
- master | |
testing: | |
stage: test | |
variables: | |
NODE_ENV: "development" | |
script: | |
- npm i --no-optional | |
- npm run test | |
type: test | |
tags: | |
- npm | |
- node | |
only: | |
- tags | |
- master | |
staging: | |
stage: deploy | |
environment: staging | |
variables: | |
NODE_ENV: "production" | |
script: | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo "$SSH_RUNNER_KEY") | |
- mkdir -p ~/.ssh | |
- npm i pm2 -g | |
- pm2 deploy ecosystem.json staging | |
type: deploy | |
tags: | |
- npm | |
- node | |
only: | |
- master | |
production: | |
stage: deploy | |
environment: production | |
variables: | |
NODE_ENV: "production" | |
script: | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo "$SSH_RUNNER_KEY") | |
- mkdir -p ~/.ssh | |
- npm i pm2 -g | |
- pm2 deploy ecosystem.json production | |
type: deploy | |
tags: | |
- npm | |
- node | |
only: | |
- tags | |
- trigger |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment