Skip to content

The swiss army knife of lossless video/audio editing

Rebuild the website when a release is published, so the homepage shows the new version

Claudee2a49121894e
diff --git a/.github/workflows/website-release-deploy.yml b/.github/workflows/website-release-deploy.yml
new file mode 100644
index 00000000..d7f41ed9
--- /dev/null
+++ b/.github/workflows/website-release-deploy.yml
@@ -0,0 +1,25 @@
+name: Website deploy after release
+
+# The homepage shows the latest release's version (website/src/latestRelease.ts), which Cloudflare only updates when it
+# rebuilds the site, and a release doesn't change the website's files. So rebuild it when a release is published.
+
+on:
+ release:
+ types: [published]
+
+permissions: {}
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ steps:
+ # A deploy hook of the losslesscut-app Worker for the master branch (Cloudflare dashboard: Settings > Builds > Deploy Hooks)
+ - env:
+ CLOUDFLARE_DEPLOY_HOOK_URL: ${{ secrets.CLOUDFLARE_DEPLOY_HOOK_URL }}
+ run: |
+ if [ -z "$CLOUDFLARE_DEPLOY_HOOK_URL" ]; then
+ echo "No CLOUDFLARE_DEPLOY_HOOK_URL secret, skipping"
+ exit 0
+ fi
+ curl --fail-with-body -sS -X POST "$CLOUDFLARE_DEPLOY_HOOK_URL"
diff --git a/website/README.md b/website/README.md
index 4686ab5e..d4818778 100644
--- a/website/README.md
+++ b/website/README.md
@@ -43,6 +43,7 @@ Build settings:
- Preview command (non-production branches): `npx wrangler preview`
- Branch control: production branch `master`, with builds for non-production branches enabled
- Build watch paths: include `website/*`, `docs/*`, `src/common/websiteUrls.ts`, `src/common/links.ts`, `src/renderer/src/icon.svg` and `*.svg` (the store badges in the repo root; `*` also matches subfolders, so this also covers other SVGs, which is harmless), so that app-only changes don't trigger a deploy
+- Deploy hook: one for `master`, in the `CLOUDFLARE_DEPLOY_HOOK_URL` repository secret, so that `.github/workflows/website-release-deploy.yml` rebuilds the site when a release is published (for the homepage's latest version)
- Variables (build): `GITHUB_TOKEN`, a fine-grained personal access token with read-only access to public repositories, so the homepage's star count (`src/githubStars.ts`) and latest version (`src/latestRelease.ts`) aren't rate limited. Optional: without it, the last known star count may be shown, and the version left out
The Worker itself (name, static assets in `dist/`, URL handling) is configured in `wrangler.jsonc`, the Node.js version in `.node-version`, and the Wrangler version used for deploys and previews (4.135.0 or later for previews) by `wrangler` in `package.json`.