Merge pull request #41 from cf15-t5/development #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |