-
Notifications
You must be signed in to change notification settings - Fork 61
41 lines (33 loc) · 1.17 KB
/
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
33
34
35
36
37
38
39
40
41
name: Deploy to Server
on:
push:
branches:
- deploytest
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: Add host
run: |
ssh-keyscan zenful.cloud > ~/.ssh/known_hosts
- name: Set up Docker Compose
run: |
# Install Docker Compose
curl -L "https://github.com/docker/compose/releases/download/v2.19.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- name: Run Docker Compose
run: |
echo DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DOCKER_HOST=ssh://[email protected] docker-compose -f ./compose.prod.yaml up -d
# - name: Copy over the docker compose file
# run: |
# scp -o StrictHostKeyChecking=no compose.prod.yaml [email protected]:guestbook/compose.yaml
# - name: Deploy code via SSH
# run: |
# ssh -o StrictHostKeyChecking=no [email protected] "cd guestbook && docker compose up -d"