-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 932 Bytes
/
cd.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
name: Continuous Delivery
on:
push:
branches:
- main
jobs:
CD:
runs-on: ubuntu-latest
steps:
- name: Checkout app
uses: actions/checkout@v4
- name: Deploy app
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
source: "."
target: "~/smart-farming-scp"
- name: Run app
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
script: |
cd ~/smart-farming-scp
env_file_string=$(echo ${{ secrets.ENV_FILE }})
echo $env_file_string | tr ' ' '\n' | sed 's/\([^=]\+\)=\([^ ]\+\)/\1=\2/' > ~/smart-farming-scp/.env
docker compose up -d