-
Notifications
You must be signed in to change notification settings - Fork 568
40 lines (33 loc) · 1.38 KB
/
deploy-do-droplet-pre-demo.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
32
33
34
35
36
37
38
39
name: Deploy to DigitalOcean Droplet Stage
on:
push:
branches:
- test-do-droplet2
jobs:
deploy:
runs-on: buildjet-4vcpu-ubuntu-2204
environment: stage
steps:
- name: checkout out code
uses: actions/checkout@v4
- name: Generate TLS Secrets for DO Droplet
run: |
rm -f $GITHUB_WORKSPACE/.deploy/ssh/ingress.api.crt $GITHUB_WORKSPACE/.deploy/ssh/ingress.api.key
echo ${{ secrets.INGRESS_API_CERT }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/ingress.api.crt
echo ${{ secrets.INGRESS_API_CERT_KEY }} | base64 --decode > $GITHUB_WORKSPACE/.deploy/ssh/ingress.api.key
- name: Copy file via scp
uses: appleboy/scp-action@master
with:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
source: '.deploy/ssh/docker-compose.api.demo.pre.yml,.deploy/ssh/nginx.demo.pre.conf,.deploy/ssh/ingress.api.crt,.deploy/ssh/ingress.api.key'
target: '.'
- name: Deploy to DigitalOcean Droplet
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DO_DROPLET_DEMO_HOST}}
username: ${{secrets.DO_DROPLET_USERNAME}}
key: ${{secrets.DO_DROPLET_KEY}}
script: |
docker-compose -f .deploy/ssh/docker-compose.api.demo.pre.yml up -d