-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 922 Bytes
/
Copy pathdeploy.yaml
File metadata and controls
34 lines (32 loc) · 922 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
# @format
name: Deploy worker code on ec2
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
key: ${{ secrets.SSH_KEY }}
script: |
cd remote-machine/worker
git pull origin main
docker system prune -af
docker build -f Dockerfile.gcc -t cp-judge-gcc:latest .
docker compose down
docker compose up --build -d --scale app=2
# script: |
# cd remote-machine/worker
# echo "Freeing disk space..."
# docker system prune -af --volumes
# docker image prune -af
# git pull origin main
# docker compose up --build -d