Merge pull request #27 from jmuzina/build-updates #15
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: gpxvis.com | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Stop GPX Vis and force-remove previous artifact | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
script: | | |
sudo systemctl stop ${{ secrets.DAEMON_NAME }} | |
sudo rm -rf ${{ secrets.DEPLOY_PATH }} | |
- name: Upload updated flask code | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
source: "*" | |
target: ${{ secrets.DEPLOY_PATH }} | |
tar_tmp_path: ${{ secrets.TEMP_PATH }} | |
rm: false | |
timeout: 60s | |
- name: Install Flask dependencies and restart Flask | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
script: | | |
pip3 install -r ${{ secrets.DEPLOY_PATH }}/requirements.txt | |
touch ${{ secrets.DEPLOY_PATH }}/.env | |
echo APP_ADDRESS="${{ secrets.APP_ADDRESS }}" >> ${{ secrets.DEPLOY_PATH}}/.env | |
echo STRAVA_CLIENT_ID="${{ secrets.STRAVA_CLIENT_ID }}" >> ${{ secrets.DEPLOY_PATH}}/.env | |
echo STRAVA_CLIENT_SECRET="${{ secrets.STRAVA_CLIENT_SECRET }}" >> ${{ secrets.DEPLOY_PATH}}/.env | |
sudo systemctl restart ${{ secrets.DAEMON_NAME }} |