python3 instead of python #9
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
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install UI Dependencies | |
run: | | |
cd ui | |
npm install | |
- name: Build UI | |
run: | | |
cd ui | |
npm run build | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install Backend Dependencies | |
run: | | |
cd backend | |
pip install -r requirements.txt | |
- name: Save Build Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: | | |
ui/build | |
backend | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-artifacts | |
- name: Setup SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Stop Running Backend | |
run: | | |
ssh ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} 'sudo systemctl stop sdcompare' | |
- name: Deploy UI to Server | |
run: | | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" ui/build/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/home/sdcompare/sdcompare/ui/ | |
- name: Deploy Backend to Server | |
run: | | |
rsync -avz -e "ssh -o StrictHostKeyChecking=no" backend/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/home/sdcompare/sdcompare/backend/ | |
- name: Start Backend | |
run: | | |
ssh ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} 'sudo systemctl start sdcompare' |