update server as well
Build and push / Pulling repo on server (push) Successful in 2s Details
/ update_database (push) Failing after 13m51s Details

This commit is contained in:
Christian Haschek 2023-12-22 22:09:04 +01:00
parent a22dbd7eaf
commit 1b5d515724
1 changed files with 22 additions and 0 deletions

View File

@ -21,4 +21,26 @@ jobs:
git add crawler/data.db
git commit -m "update database"
git push
- name: Configure SSH
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/staging.key
chmod 600 ~/.ssh/staging.key
- name: Run git pull on Server
run: |
ssh -i ~/.ssh/staging.key -o StrictHostKeyChecking=no -p 22 -o UserKnownHostsFile=/dev/null ${{ secrets.SSH_WEBSERVER_IP }} "cd /var/www/dogstats/ && git pull"
- name: Prepare
id: prep
run: |
SHORTREF=${GITHUB_SHA::10}
# Set output parameters.
echo ::set-output name=shortref::${SHORTREF}
- name: Updating version
run: |
ssh -i ~/.ssh/staging.key -o StrictHostKeyChecking=no -p 22 -o UserKnownHostsFile=/dev/null ${{ secrets.SSH_WEBSERVER_IP }} "echo v${{ steps.prep.outputs.shortref }} > /var/www/dogstats/web/version.txt"