fix: deploy from server git checkout instead of scp overlay

This commit is contained in:
cesnimda
2026-03-22 22:42:07 +01:00
parent 42bc642bfa
commit c8e1c2b338
+7 -12
View File
@@ -48,18 +48,6 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload deploy bundle to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USER }}
key: ${{ secrets.PROD_SSH_KEY }}
source: "."
target: "/opt/job-tracker/app"
- name: Run remote deploy
uses: appleboy/ssh-action@v1.0.3
with:
@@ -67,7 +55,14 @@ jobs:
username: ${{ secrets.PROD_USER }}
key: ${{ secrets.PROD_SSH_KEY }}
script: |
if [ ! -d /opt/job-tracker/app/.git ]; then
echo "Expected git checkout at /opt/job-tracker/app but .git was not found."
exit 1
fi
cd /opt/job-tracker/app
git fetch --all --prune
git reset --hard ${{ github.sha }}
git clean -fd
chmod +x deploy/deploy.sh
APP_VERSION=${{ github.run_number }} \
APP_COMMIT_SHA=${{ github.sha }} \