Use helper script
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-12-29 10:55:45 +01:00
parent f394456e7b
commit 57736e1d86

View file

@ -11,12 +11,8 @@ steps:
- docker-compose -f docker-compose.build.yml build - docker-compose -f docker-compose.build.yml build
- docker push git.webdeploy.it/pianello/frontend:latest - docker push git.webdeploy.it/pianello/frontend:latest
- docker push git.webdeploy.it/pianello/frontend:$(jq -r .version ./frontend/package.json) - docker push git.webdeploy.it/pianello/frontend:$(jq -r .version ./frontend/package.json)
# DEPLOY STUFF #### Deploy
- eval $(ssh-agent -s) - config_ssh.sh "$${RUNNER_PRIVATE_KEY}"
- mkdir -p ~/.ssh
- printf "%s" "$${RUNNER_PRIVATE_KEY}" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh-add ~/.ssh/id_ed25519
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- cat .env | ssh pianello@pianello.webdeploy.it "cat - > .env" # copy env - cat .env | ssh pianello@pianello.webdeploy.it "cat - > .env" # copy env
- cat docker-compose.prod.yml | ssh pianello@pianello.webdeploy.it "cat - > docker-compose.yml && docker compose pull && docker compose up -d --remove-orphans" - cat docker-compose.prod.yml | ssh pianello@pianello.webdeploy.it "cat - > docker-compose.yml && docker compose pull && docker compose up -d --remove-orphans"