-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (43 loc) · 1.24 KB
/
proxy_dev.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
on:
push:
branches:
- develop
paths:
- docker-compose-caddy.yml
- caddy/Caddyfile.dev
- .github/workflows/proxy.yaml
jobs:
proxy-initialize:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create .env file
run: |
echo "URL=${{secrets.URL_DEV}}" > .env
echo "LOCAL_IP=${{secrets.LOCAL_IP_DEV}}" >> .env
-
name: SCP Command to Transfer Files
uses: appleboy/scp-action@v0.1.4
with:
host: ${{secrets.SSH_HOST_DEV}}
username: ${{secrets.SSH_USER}}
key: ${{secrets.SSH_KEY}}
source: "docker-compose-caddy.yml, .env, caddy/Caddyfile.dev"
target: "~/proxy"
overwrite: true
-
name: SSH Command to Run Docker Compose
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{secrets.SSH_HOST_DEV}}
username: ${{secrets.SSH_USER}}
key: ${{secrets.SSH_KEY}}
script: |
cd ~/proxy
mv caddy/Caddyfile.dev caddy/Caddyfile
source .env
docker-compose -f docker-compose-caddy.yml down
docker-compose -f docker-compose-caddy.yml up -d