-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 1.77 KB
/
cd.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
on:
workflow_dispatch:
push:
branches:
- production
jobs:
django:
name: Deploy Django
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
- name: Collect static files
working-directory: ./backend/
run: python manage.py collectstatic
- name: Deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "backend/"
TARGET: "/home/${{ secrets.USERNAME }}/backend/"
REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_USER: ${{ secrets.USERNAME }}
REMOTE_PORT: ${{ secrets.PORT }}
SCRIPT_BEFORE: |
rm -rf backend/
mkdir backend/
sveltekit:
name: Deploy Sveltekit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/[email protected]
- name: Install packages and build
working-directory: ./frontend/
run: npm i --omit=dev && npm run build
- name: Deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "./frontend/build/ ./package.json ./package-lock.json"
TARGET: "/home/${{ secrets.USERNAME }}/frontend/"
REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_USER: ${{ secrets.USERNAME }}
REMOTE_PORT: ${{ secrets.PORT }}
SCRIPT_BEFORE: |
rm -rf ./frontend/
mkdir ./frontend/
SCRIPT_AFTER: |
cd ./frontend/ && npm ci --omit=dev