2024-01-04 18:08:13 +01:00
|
|
|
when:
|
|
|
|
branches: [master, ci, deploy]
|
|
|
|
event: push
|
|
|
|
|
|
|
|
steps:
|
2023-03-05 18:45:56 +01:00
|
|
|
build:
|
|
|
|
image: node:18-alpine
|
|
|
|
commands:
|
|
|
|
- npm ci
|
|
|
|
- npm run build
|
|
|
|
deploy:
|
|
|
|
image: alpine:3
|
|
|
|
commands:
|
|
|
|
- apk add --no-cache rsync openssh age
|
|
|
|
- echo $${AGE_KEY} > ./deploy/age_key_priv
|
|
|
|
- age --decrypt -i ./deploy/age_key_priv -o ./deploy/ssh_key_dec ./deploy/ssh_key
|
|
|
|
- chmod 600 ./deploy/ssh_key_dec
|
2024-01-04 18:08:13 +01:00
|
|
|
- rsync -avz --delete -e "ssh -p 2222 -i $PWD/deploy/ssh_key_dec -o UserKnownHostsFile=$PWD/deploy/known_hosts" dist/ www@192.168.30.215:/www
|
2023-03-05 18:45:56 +01:00
|
|
|
- rm -rf deploy
|
|
|
|
secrets: [age_key]
|
|
|
|
when:
|
|
|
|
branch: [ci, deploy]
|