-
-
Notifications
You must be signed in to change notification settings - Fork 117
50 lines (46 loc) · 1.96 KB
/
Copy pathrefresh-marketing.yml
File metadata and controls
50 lines (46 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Refresh marketing site
# Calls the marketing site's on-demand ISR revalidation endpoint so
# helmor.ai reflects a new version within seconds of a release going live,
# instead of waiting for the 3600s ISR window in `apps/marketing/lib/github.ts`.
#
# Triggered on `release.published` for manual releases or a draft being
# published outside publish.yml. Releases created by a workflow with
# `GITHUB_TOKEN` do not trigger this workflow, so publish.yml also performs
# a direct revalidation after a non-draft release completes.
#
# `workflow_dispatch` is kept for first-time verification and manual recovery.
#
# Failure mode: if this workflow fails, the 3600s ISR fallback still works --
# helmor.ai is at worst ~1 hour stale, never broken.
on:
release:
types: [published]
workflow_dispatch:
concurrency:
group: refresh-marketing
cancel-in-progress: false
jobs:
revalidate:
# Skip prereleases (marketing site only tracks stable latest). `workflow_dispatch`
# has no release payload, so this condition must allow it through.
if: github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Call revalidate endpoint
env:
SECRET: ${{ secrets.HELMOR_MARKETING_REVALIDATE_SECRET }}
# curl --fail makes non-2xx return an exit code; --retry handles
# transient Vercel cold starts. The secret is passed via env and
# injected into a header (never argv or URL) to keep it out of
# process listings and access logs.
run: |
if [ -z "${SECRET}" ]; then
echo "HELMOR_MARKETING_REVALIDATE_SECRET is not set"
exit 1
fi
curl --fail --silent --show-error \
--retry 3 --retry-delay 10 --retry-connrefused \
-X POST "https://helmor.ai/api/revalidate" \
-H "x-revalidate-secret: ${SECRET}" \
-H "content-type: application/json"