-
Notifications
You must be signed in to change notification settings - Fork 3
32 lines (29 loc) · 1.21 KB
/
dev-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Deploy to dev server
# when dev image build action is completed, run this action
on:
workflow_run:
workflows: ["Build docker image on push to develop"]
types:
- completed
jobs:
if_workflow_success:
name: Deploy to dev server
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: pull the image and restart the container
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.DEV_HOST }}
port: ${{ secrets.DEV_PORT }}
username: ${{ secrets.DEV_USERNAME }}
password: ${{ secrets.DEV_PASSWORD }}
proxy_host: ${{ secrets.DEV_PROXY_HOST }}
proxy_port: ${{ secrets.DEV_PROXY_PORT }}
proxy_username: ${{ secrets.DEV_PROXY_USERNAME }}
proxy_password: ${{ secrets.DEV_PROXY_PASSWORD }}
script_stop: true # stop script if any command has failed
script: |
cd ${{ secrets.DEV_WORKING_DIRECTORY }}
docker compose -f .docker/docker-compose.stage.yml -p zabo --env-file=.docker/.env.prod pull
docker compose -f .docker/docker-compose.stage.yml -p zabo --env-file=.docker/.env.prod up --force-recreate --build -d