From f224c7536b737da27efa5b766550f2b404193135 Mon Sep 17 00:00:00 2001 From: Adrien Carpentier Date: Tue, 21 Jan 2025 20:37:00 +0900 Subject: [PATCH] ci: fix CI --- .github/workflows/deploy_tag.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_tag.yml b/.github/workflows/deploy_tag.yml index e83ba3f..eacacea 100644 --- a/.github/workflows/deploy_tag.yml +++ b/.github/workflows/deploy_tag.yml @@ -10,7 +10,11 @@ jobs: name: Deploy to prod from ${{ github.ref_name }}/${{ github.sha }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + + - name: Checkout repo + uses: actions/checkout@v4 + with: + ref: ${{ needs.update-changelog.outputs.commit_hash }} # https://schnerring.net/blog/checking-out-code-committed-within-the-same-github-actions-workflow-run/ - name: Install uv uses: astral-sh/setup-uv@v3 @@ -43,7 +47,7 @@ jobs: run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts - name: Execute server commands for deploy - uses: appleboy/ssh-action@v1.1.0 + uses: appleboy/ssh-action@v1.2.0 with: host: ${{ secrets.SSH_HOST }} username: ${{ secrets.SSH_USER }} @@ -51,10 +55,11 @@ jobs: script_stop: true script: | cd /home/www/vj-api - git pull + git fetch + git reset --hard origin/main /usr/local/bin/uv/bin/uv sync - /usr/local/bin/uv/bin/uv run /home/www/blockhaus101/manage.py migrate - /usr/local/bin/uv/bin/uv run /home/www/blockhaus101/manage.py collectstatic --no-input + /usr/local/bin/uv/bin/uv run /home/www/vj-api/manage.py migrate + /usr/local/bin/uv/bin/uv run /home/www/vj-api/manage.py collectstatic --no-input sudo systemctl restart vj-api.service - name: Create Sentry release