-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.07 KB
/
deploy-docker-containers.yml
File metadata and controls
37 lines (31 loc) · 1.07 KB
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
# copy docker-compose.yml to digitalocean and run docker-compose
name: docker-compose
on: [push]
jobs:
deploy_production:
if: startsWith(github.ref, 'refs/tags/')
name: production deployment to digitalocean.com
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v2
- name: copy & run stage
uses: alinz/ssh-scp-action@master
with:
key: ${{ secrets.DEPLOY_KEY }}
host: ${{ secrets.APP_HOST }}
user: ${{ secrets.DEPLOY_USER }}
# runs this on remove server
ssh_before: |
echo 'PRODUCTION: deploying ${{ github.ref }}'
cd /var/gendercomics/docker
ls -lath
# then upload docker-compose.yml
scp: |
./docker-compose.yml ${{ secrets.DEPLOY_USER }}@${{ secrets.APP_HOST }}:/var/gendercomics/docker
# then run these commands
ssh_after: |
echo 'running docker-compose'
cd /var/gendercomics/docker
docker-compose up -d
echo 'DONE!!!'