-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (29 loc) · 1014 Bytes
/
deploy.yml
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
---
name: Deploy to server
on: workflow_dispatch
jobs:
deploy_to_server:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > private_key.pem
chmod 600 private_key.pem
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
- name: Deploy to server
run: |
ssh -i private_key.pem ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} <<'ENDSSH'
docker pull johnshaughnessy/track-server
docker container stop track-container || true
docker container rm track-container || true
docker run \
-d \
--name track-container \
-p 80:8080 \
-v track-server-data:/data \
--env APP_ENV=prod \
--env DB_PATH=/data/prod_db.sqlite3 \
--env IP_ADDRESS=0.0.0.0 \
--env PORT=8080 \
johnshaughnessy/track-server
ENDSSH