-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.63 KB
/
cd.yml
File metadata and controls
60 lines (57 loc) · 1.63 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
# This is a basic workflow to help you get started with Actions
name: CD
on:
push:
branches: [master]
jobs:
build_and_deploy_website:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup Node.js
uses: actions/setup-node@v2.1.4
with:
node-version: "16.x"
- name: Install and build
working-directory: ./website
run: |
npm i
npm run build
mv build ..
- name: Copy files via SSH
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "build"
target: "/var/www/stackdb"
overwrite: true
populate_db:
runs-on: ubuntu-latest
steps:
- name: Populate the dgraph DB with new yml data
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script_stop: true
script: |
cd stackdb
docker-compose down
git submodule update --recursive --remote
cd yml_to_graphql
npm i
cd ..
docker-compose -f docker-compose-populate.yml up -d
sleep 25
./populate_db.sh
./query_all_db.sh
docker-compose -f docker-compose-populate.yml down
docker-compose up -d