pianello-web-app/.woodpecker/.build.yml
Alessio Davoli 57736e1d86
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Use helper script
2023-12-29 10:55:45 +01:00

23 lines
1.2 KiB
YAML

steps:
build_and_deploy:
image: git.webdeploy.it/webdeploy/alpine
secrets: [docker_password, docker_username, runner_private_key]
commands:
################### Provisioning
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
- echo "TAG=$(jq -r .version ./frontend/package.json)" >> .env
- echo "ORIGIN=https://pianello.webdeploy.it" >> .env
- echo "PUBLIC_BACKEND_URL=https://ale-dev.teck-developer.com" >> ./frontend/.env
- docker-compose -f docker-compose.build.yml build
- docker push git.webdeploy.it/pianello/frontend:latest
- docker push git.webdeploy.it/pianello/frontend:$(jq -r .version ./frontend/package.json)
#### Deploy
- config_ssh.sh "$${RUNNER_PRIVATE_KEY}"
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- 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"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
branch: main