-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.25 KB
/
deployment.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
# CI/CD Name
name: 'Deployment'
# Trigger the workflow on pushes to the master branch
on:
push:
branches:
- master
jobs:
build:
# Run on the latest version of Ubuntu
runs-on: ubuntu-latest
steps:
# Check out the repository to access its contents
- name: Checkout Repository
uses: actions/checkout@v2
# Set up Node.js for Installing Dependencies
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
# Install Python dependencies using pip
- name: Install Python Dependencies
run: pip install -r requirement.txt
deploy:
needs: build
# Run on the latest version of Ubuntu
runs-on: ubuntu-latest
steps:
# Deploy the application to the VPS
- name: Deploy to VPS
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOSTNAME }}
username: ${{ secrets.VPS_USERNAME }}
password: ${{ secrets.VPS_PASSWORD }}
port: ${{ secrets.VPS_PORT }}
script: |
cd seticket-backend/
export FLASK_APP=server.py
git pull
pip install -r requirement.txt
flask db upgrade
pm2 restart seticket-backend