ci: auto-trigger landing redeploy when a GitHub release is published

Companion to the VITE_LATEST_VERSION injection in landing/deploy-landing.yml.
That workflow reads the latest release tag at build time, but it only
runs on pushes to the landing-page branch. This workflow listens for
release events on main (published / edited / released) and dispatches
deploy-landing so the Mac DMG download link gets refreshed without a
manual commit to landing-page.

Flow:
  1. Admin runs release.sh and `gh release create vX.Y.Z ...`
  2. GitHub fires `release: published`
  3. This workflow dispatches deploy-landing.yml on landing-page
  4. deploy-landing fetches the new tag and rebuilds the site

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
徐翔宇 2026-04-19 00:44:29 +08:00
parent fb275721cf
commit db3d154a02

View file

@ -0,0 +1,29 @@
name: Trigger Landing Deploy on Release
# Rebuilds & redeploys the landing page whenever a GitHub Release is
# published, edited, or released. The actual build/deploy logic lives
# in .github/workflows/deploy-landing.yml on the `landing-page` branch;
# this workflow only fires a workflow_dispatch at it so the Mac DMG
# download CTA on miomioos.github.io picks up the new tag automatically.
on:
release:
types: [published, edited, released]
workflow_dispatch:
permissions:
actions: write
contents: read
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger landing-page rebuild
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run deploy-landing.yml \
--repo ${{ github.repository }} \
--ref landing-page
echo "Dispatched deploy-landing.yml on landing-page branch."