-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.37 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
42
43
44
45
46
47
48
name: deploy UI to remote server
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: copy file via ssh
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
passphrase: ${{ secrets.PASSWORD }}
key: ${{ secrets.SSH_KEY }}
source: "docker-compose.yml"
target: "sawyerburnett-nextjs"
rm: true
- name: run bash script
uses: appleboy/ssh-action@master
env:
CR_PAT: ${{ secrets.CR_PAT }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
passphrase: ${{ secrets.PASSWORD }}
key: ${{ secrets.SSH_KEY }}
envs: CR_PAT
script: |
cd sawyerburnett-nextjs/
# build a new docker container based upon updated repository
docker login https://ghcr.io/burnett2k -u burnett2k -p $CR_PAT
docker pull ghcr.io/burnett2k/sawyerburnett-nextjs:latest
# start the docker container
docker-compose up -d
echo "cleaning up dingleberries"
docker system prune -a -f
# list currently running containers
docker ps