-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (71 loc) · 2.21 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
61
62
63
64
65
66
67
68
69
70
71
72
name: FTP Deployment to production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install python requirements
working-directory: backend
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --deploy --dev
- name: Install node requirements
run: npm install
working-directory: frontend
- name: Create static backend files
working-directory: backend
run: pipenv run python manage.py collectstatic
- name: Move static files into httpdocs
run: |
mkdir -p httpdocs
mv -v backend/static httpdocs
- name: Create / touch restart.txt for passenger restart
run: |
mkdir backend/tmp
touch backend/tmp/restart.txt
current_date=$(date +"%d.%m.%Y %T")
echo "$current_date" > backend/tmp/restart.txt
- name: create backend requirements file
run: pipenv requirements > requirements.txt
working-directory: backend
- name: Build Angular App
run: npm run build
working-directory: frontend
- name: Move frontend files into httpdocs
run: |
mv -v frontend/dist/frontend/browser/de/* httpdocs
- name: Cleaning files
run: |
rm -rf frontend
rm -rf utils
rm -rf .vscode
rm -rf .github
- name: Deploy over FTP
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: /
local-dir: ./
dry-run: false
exclude: |
**/.git*
**/.git*/**
**/node_modules/**
**/__pycache__/**