-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.37 KB
/
Deploy.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
40
41
42
43
44
45
# CD Pipeline
name: 'cd'
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '19.x'
- name: Install Dependencies
run: npm ci
- name: Build the "public" directory
run: python3 ./make_public_dir.py
working-directory: ./backend/ontario-web
- name: Copy "public" directory to AWS Lightsail
uses: appleboy/scp-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_KEY }}
port: ${{ secrets.AWS_PORT }}
source: "./backend/ontario-web/public"
target: "/home/bitnami/public-temp"
- name: Deploy to AWS Lightsail
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.AWS_USERNAME }}
key: ${{ secrets.AWS_KEY }}
port: ${{ secrets.AWS_PORT }}
script: |
pushd /home/bitnami/pictonode/backend/ontario-web
git checkout -- .
git pull origin master
rm -rf ./public
cp -r /home/bitnami/public-temp/backend/ontario-web/public ./
rm -rf /home/bitnami/public-temp
sudo supervisorctl restart ontario_web