22 lines
642 B
YAML
22 lines
642 B
YAML
when:
|
|
branches: [master, ci, deploy]
|
|
event: push
|
|
|
|
steps:
|
|
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
|
|
- 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
|
|
- rm -rf deploy
|
|
secrets: [age_key]
|
|
when:
|
|
branch: [ci, deploy]
|