Skip to content

Fetch data every time #26

Fetch data every time

Fetch data every time #26

Workflow file for this run

name: Deploying to VPS
on:
push:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Calculate short hash
run: |
shortHash=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$shortHash" >> $GITHUB_ENV
- name: SSH setup and run commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
username: ${{ secrets.SSH_USER }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
cd ./deploy/${{ github.event.repository.name }}
git pull
docker rm --force ${{ github.event.repository.name }}-deploy 2> /dev/null
docker build -t ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }} --quiet .
docker run --detach --publish 5000:5000 --name ${{ github.event.repository.name }}-deploy ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }}
docker container prune --force && docker image prune --all --force