-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.36 KB
/
deploy.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Node.js CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [21.x]
steps:
- run: systemctl stop nginx
# - run: killall node
# - run: docker container kill $(docker container ls -q)
- run: cd backend
- run: cd soc_docker_service
- run: docker-compose up -d db redis
- run: sleep 5
- run: docker-compose up -d
- run: sleep 5
- run: cd ..
- name: Create .env with Github Secrets and run script
run: |
touch .env
echo PORT=$ENV_VAR_1 >> .env
echo COMPILER_PORT=$ENV_VAR_2 >> .env
echo DB_HOST=$ENV_VAR_3 >> .env
echo DB_PORT=$ENV_VAR_4 >> .env
echo DB_USER=$ENV_VAR_5 >> .env
echo DB_PASSWORD=$ENV_VAR_6 >> .env
echo DB_NAME=$ENV_VAR_7 >> .env
env:
ENV_VAR_1: ${{ secrets.ENV_VAR_1 }}
ENV_VAR_2: ${{ secrets.ENV_VAR_2 }}
ENV_VAR_3: ${{ secrets.ENV_VAR_3 }}
ENV_VAR_4: ${{ secrets.ENV_VAR_4 }}
ENV_VAR_5: ${{ secrets.ENV_VAR_5 }}
ENV_VAR_6: ${{ secrets.ENV_VAR_6 }}
ENV_VAR_7: ${{ secrets.ENV_VAR_7 }}
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm start &
- run: sleep 5
- run: cd ../frontend
- name: Create .env with Github Secrets and run script
run: |
touch .env
echo REACT_APP_COMPILATION_URL=$ENV_VAR_11 >> .env
echo REACT_APP_GOOGLE_AUTH=$ENV_VAR_22 >> .env
echo REACT_APP_CODEDB=$ENV_VAR_33 >> .env
echo REACT_APP_AUTH0_DOMAIN=$ENV_VAR_44 >> .env
echo REACT_APP_AUTH0_CLIENT_ID=$ENV_VAR_55 >> .env
echo REACT_APP_CLIENT_URL=$ENV_VAR_66 >> .env
env:
ENV_VAR_11: ${{ secrets.ENV_VAR_11 }}
ENV_VAR_22: ${{ secrets.ENV_VAR_22 }}
ENV_VAR_33: ${{ secrets.ENV_VAR_33 }}
ENV_VAR_44: ${{ secrets.ENV_VAR_44 }}
ENV_VAR_55: ${{ secrets.ENV_VAR_55 }}
ENV_VAR_66: ${{ secrets.ENV_VAR_66 }}
- run: npm install
- run: npm run build
- run: systemctl start nginx