diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index fa7287b..426f08c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -32,9 +32,17 @@ jobs: "${{ secrets.ANSIBLE_USER }}" > /tmp/inventory.ini - name: Download ARM Release Artifacts + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SERVER_URL: ${{ github.server_url }} + REPOSITORY: ${{ github.repository }} run: | - TAG="${{ github.event.workflow_run.head_branch }}" - BASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/download/${TAG}" + TAG=$(curl -sf \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${SERVER_URL}/api/v1/repos/${REPOSITORY}/releases?limit=1&page=1" \ + | python3 -c "import sys, json; print(json.load(sys.stdin)[0]['tag_name'])") + echo "Deploying release tag: ${TAG}" + BASE_URL="${SERVER_URL}/${REPOSITORY}/releases/download/${TAG}" wget --fail -q "${BASE_URL}/brainwave-arm64.tar.gz" || { echo "Failed to download ARM tarball from ${BASE_URL}"; exit 1; } wget --fail -q "${BASE_URL}/docker-compose.arm64.yml" || { echo "Failed to download docker-compose file from ${BASE_URL}"; exit 1; }