Skip to content

temp hide web7

temp hide web7 #61

Workflow file for this run

name: Deploy to server
on: push
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/staging.key
chmod 600 ~/.ssh/staging.key
cat >>~/.ssh/config <<END
Host staging
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/staging.key
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
- name: Stop the server
run: ssh staging 'supervisorctl stop flask'
# - name: Update Steckbriefe
# run: ssh staging 'cd ${{ secrets.STECKBRIEFE_PATH }} && git pull'
# - name: Update Arbeitsblaetter
# run: ssh staging 'cd ${{ secrets.ARBEITSBLAETTER_PATH }} && git pull'
- name: Update Flask App
run: ssh staging 'cd ${{ secrets.APP_PATH }} && git pull'
- name: Start the server
# if: ${{ always() }}
run: ssh staging 'supervisorctl start flask'