File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy API to Render and VPS
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows :
6
+ - Build API image
7
+ branches :
8
+ - main
9
+ types :
10
+ - completed
11
+
12
+ jobs :
13
+ deploy-render :
14
+ runs-on : ubuntu-latest
15
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
16
+ steps :
17
+ - name : install curl
18
+ run : sudo apt-get update && sudo apt-get install -y curl
19
+ - name : send Render API deploy webhook
20
+ run : curl ${{ secrets.RENDER_WEBHOOK }}
21
+ deploy-vps :
22
+ runs-on : ubuntu-latest
23
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@v4
27
+ - name : Remove old container
28
+ run : |
29
+ echo ${{ secrets.FROG_KEY }} | base64 -d > frog &&
30
+ chmod 600 frog &&
31
+ ssh -o StrictHostKeyChecking=no -i frog ${{ secrets.FROG_ADDRESS }} -p${{ secrets.FROG_PORT }} "docker rm -f flush-log-api" || true
32
+
33
+ - name : Remove old image
34
+ run : |
35
+ echo ${{ secrets.FROG_KEY }} | base64 -d > frog &&
36
+ chmod 600 frog &&
37
+ ssh -o StrictHostKeyChecking=no -i frog ${{ secrets.FROG_ADDRESS }} -p${{ secrets.FROG_PORT }} "docker image rm ghcr.io/pgulb/flush-log:api" || true
38
+
39
+ - name : Deploy fresh container
40
+ run : |
41
+ echo ${{ secrets.FROG_KEY }} | base64 -d > frog &&
42
+ chmod 600 frog &&
43
+ ssh -o StrictHostKeyChecking=no -i frog ${{ secrets.FROG_ADDRESS }} -p${{ secrets.FROG_PORT }} "docker run -d -p 30149:6789 -e MONGO_URL='${{ secrets.MONGO_URL }}' --name flush-log-api --restart=unless-stopped ghcr.io/pgulb/flush-log:api"
You can’t perform that action at this time.
0 commit comments