2024-02-23 18:28:49 +00:00
|
|
|
steps:
|
|
|
|
build:
|
2024-03-01 19:51:12 +00:00
|
|
|
# Build and test
|
2024-02-23 18:28:49 +00:00
|
|
|
image: node
|
|
|
|
commands:
|
|
|
|
- yarn install --frozen-lockfile
|
|
|
|
- yarn build
|
|
|
|
when:
|
|
|
|
event: [ push, pull_request ]
|
|
|
|
branch: [ hotfix/*, feature/*, renovate/*, develop, main ]
|
|
|
|
lint:
|
|
|
|
image: node
|
|
|
|
commands:
|
|
|
|
- yarn lint
|
|
|
|
when:
|
|
|
|
event: [ push, pull_request ]
|
|
|
|
branch: [ hotfix/*, feature/*, renovate/*, develop, main ]
|
|
|
|
test:
|
|
|
|
image: node
|
|
|
|
commands:
|
|
|
|
- yarn test
|
|
|
|
when:
|
|
|
|
event: [ push, pull_request ]
|
|
|
|
branch: [ hotfix/*, feature/*, renovate/*, develop, main ]
|
2024-03-01 19:51:12 +00:00
|
|
|
|
|
|
|
# Package production build
|
|
|
|
package_prod:
|
|
|
|
image: node
|
|
|
|
commands:
|
2024-04-15 18:42:03 +01:00
|
|
|
- apt install unzip -y
|
|
|
|
- wget https://github.com/xerub/ldid/releases/download/42/ldid.zip
|
|
|
|
- unzip ldid.zip
|
2024-04-15 18:45:34 +01:00
|
|
|
- mkdir /opt/ldid/
|
|
|
|
- cp linux64/ldid /opt/ldid/
|
2024-04-15 18:42:03 +01:00
|
|
|
- export PATH=/opt/ldid:$PATH
|
2024-03-01 19:51:12 +00:00
|
|
|
- yarn package
|
|
|
|
when:
|
2024-04-22 19:36:39 +01:00
|
|
|
event: push
|
2024-03-01 19:51:12 +00:00
|
|
|
branch: main
|
|
|
|
rsync_prod:
|
|
|
|
image: alpine
|
|
|
|
secrets: [ ssh_key ]
|
|
|
|
commands:
|
|
|
|
- apk add rsync openssh-client
|
|
|
|
- eval `ssh-agent -s`
|
|
|
|
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
2024-04-19 18:34:25 +01:00
|
|
|
- rsync -e "ssh -o StrictHostKeyChecking=no" -r ./bin vylpes@192.168.1.115:/home/vylpes/apps/random-bunny/random-bunny_prod
|
2024-03-01 19:51:12 +00:00
|
|
|
when:
|
2024-04-22 19:36:39 +01:00
|
|
|
event: push
|
2024-03-01 19:51:12 +00:00
|
|
|
branch: main
|
|
|
|
|
|
|
|
# Package stage build
|
|
|
|
package_stage:
|
|
|
|
image: node
|
|
|
|
commands:
|
2024-04-15 18:42:03 +01:00
|
|
|
- apt install unzip -y
|
|
|
|
- wget https://github.com/xerub/ldid/releases/download/42/ldid.zip
|
|
|
|
- unzip ldid.zip
|
2024-04-15 18:45:34 +01:00
|
|
|
- mkdir /opt/ldid/
|
|
|
|
- cp linux64/ldid /opt/ldid/
|
2024-04-15 18:42:03 +01:00
|
|
|
- export PATH=/opt/ldid:$PATH
|
2024-03-01 19:51:12 +00:00
|
|
|
- yarn package
|
|
|
|
when:
|
|
|
|
event: push
|
|
|
|
branch: develop
|
|
|
|
rsync_stage:
|
|
|
|
image: alpine
|
|
|
|
secrets: [ ssh_key ]
|
|
|
|
commands:
|
|
|
|
- apk add rsync openssh-client
|
|
|
|
- eval `ssh-agent -s`
|
|
|
|
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
2024-04-19 18:34:25 +01:00
|
|
|
- rsync -e "ssh -o StrictHostKeyChecking=no" -r ./bin vylpes@192.168.1.115:/home/vylpes/apps/random-bunny/random-bunny_stage
|
2024-03-01 19:51:12 +00:00
|
|
|
when:
|
|
|
|
event: push
|
|
|
|
branch: develop
|
|
|
|
|
|
|
|
# Publish to NPM
|
2024-02-23 18:28:49 +00:00
|
|
|
publish:
|
|
|
|
image: plugins/npm
|
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: NPM_USERNAME
|
|
|
|
email:
|
|
|
|
from_secret: NPM_EMAIL
|
|
|
|
password:
|
|
|
|
from_secret: NPM_PASSWORD
|
|
|
|
api_key:
|
|
|
|
from_secret: NPM_TOKEN
|
|
|
|
when:
|
|
|
|
event: tag
|
2024-04-19 18:34:25 +01:00
|
|
|
branch: main
|