-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (56 loc) · 1.51 KB
/
deploy_production.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: deploy production
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: install frontend deps and run tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
cd ./ui
npm ci
- name: build frontend
run: |
cd ./ui
npm run build:ngst-prod
- name: save build
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: ./ui/dist/ui
deploy:
runs-on: production
name: deploy to production
needs: build_frontend
environment: production
steps:
- name: checkout
uses: actions/checkout@v3
- name: copy app
run: Copy-Item -Path .\* -Destination ..\..\..\..\app\ -Recurse -Exclude ("ui", ".git", ".github") -Force
- name: run migrations and collectstatic
working-directory: ..\..\..\..\app\
env:
conda_path: ${{ vars.CONDA_ENV_PATH }}
run: |
conda activate $env:conda_path
python manage.py migrate
python manage.py collectstatic --noinput
- name: download ui
uses: actions/download-artifact@v4
with:
name: frontend-build
path: ..\..\..\..\ui\