Skip to content

Build your personal knowledge base with Trilium Notes

fix(ci): website not deploying on tag

Elian Doran1d0aff5d9f34
diff --git a/.github/actions/deploy-to-cloudflare-pages/action.yml b/.github/actions/deploy-to-cloudflare-pages/action.yml
index a3a22f9fef..3837474998 100644
--- a/.github/actions/deploy-to-cloudflare-pages/action.yml
+++ b/.github/actions/deploy-to-cloudflare-pages/action.yml
@@ -33,12 +33,13 @@ runs:
# Deploy using Wrangler (use pre-installed wrangler)
- name: Deploy to Cloudflare Pages
id: deploy
- if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
+ if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ inputs.cloudflare_api_token }}
accountId: ${{ inputs.cloudflare_account_id }}
- command: pages deploy ${{ inputs.deploy_dir }} --project-name=${{ inputs.project_name}} --branch=${{ github.ref_name }}
+ # On release events github.ref_name is the tag (e.g. v0.103.0), so force the production branch.
+ command: pages deploy ${{ inputs.deploy_dir }} --project-name=${{ inputs.project_name}} --branch=${{ github.event_name == 'release' && 'main' || github.ref_name }}
wranglerVersion: '' # Use pre-installed version
# Deploy preview for PRs