Skip to content

change ssh auth for cicd to public key #14

change ssh auth for cicd to public key

change ssh auth for cicd to public key #14

Workflow file for this run

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 }}