-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 865 Bytes
/
deploy.yaml
File metadata and controls
34 lines (29 loc) · 865 Bytes
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
33
34
name: Deploy to Production
on:
workflow_run:
workflows: ["Docker Image CI/CD"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SERVER_SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Deploy to server
env:
HOST: ${{ secrets.SERVER_HOST }}
USER: ${{ secrets.SERVER_USER }}
run: |
ssh $USER@$HOST << EOF
cd ~/projects/codeclimbers/ebb-platform/prod
docker compose pull ebb-platform
docker compose up -d --no-deps ebb-platform
docker image prune -f
EOF