Skip to content

Commit cf16c11

Browse files
committed
Fix to deployment workflow so deployment status attaches to correct commit
1 parent e9ad7eb commit cf16c11

2 files changed

Lines changed: 15 additions & 22 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ jobs:
2424
uses: actions/github-script@v8
2525
with:
2626
script: |
27-
const runId = context.payload.workflow_run.id;
27+
const workflowRun = context.payload.workflow_run;
28+
const headBranch = workflowRun?.head_branch;
29+
if (typeof headBranch === 'string' && headBranch.startsWith('hotfix/')) {
30+
core.info('hotfix/* branch detected; skipping CI job verification.');
31+
return;
32+
}
33+
34+
const runId = workflowRun.id;
2835
const requiredJobs = ['Lint', 'Unit Tests'];
2936
const { data } = await github.rest.actions.listJobsForWorkflowRun({
3037
owner: context.repo.owner,
@@ -70,11 +77,14 @@ jobs:
7077
id: vercel-preview
7178
with:
7279
vercel-token: ${{ secrets.VERCEL_TOKEN }}
80+
github-token: ${{ secrets.GITHUB_TOKEN }}
7381
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
7482
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
7583
github-comment: false
7684
env:
7785
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
86+
GITHUB_SHA: ${{ github.event.workflow_run.head_sha }}
87+
GITHUB_REF: refs/heads/${{ github.event.workflow_run.head_branch }}
7888

7989
- name: Comment preview URL on PR
8090
if: ${{ !startsWith(github.event.workflow_run.head_branch, 'hotfix/') && always() && steps.vercel-preview.outcome == 'success' }}
@@ -285,11 +295,14 @@ jobs:
285295
id: vercel-production
286296
with:
287297
vercel-token: ${{ secrets.VERCEL_TOKEN }}
298+
github-token: ${{ secrets.GITHUB_TOKEN }}
288299
vercel-args: '--prod'
289300
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
290301
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
291302
env:
292303
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
304+
GITHUB_SHA: ${{ github.event.workflow_run.head_sha }}
305+
GITHUB_REF: refs/heads/${{ github.event.workflow_run.head_branch }}
293306

294307
- name: Log production deployment
295308
if: always() && steps.vercel-production.outcome == 'success'

_TODO.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,27 +222,7 @@ The contact data collection uses an array of social networks, with keys:
222222

223223
The authors collection is using named entries under a "social" property, like "twitter", "github", etc. This task is to refactor that to use an array like contact data collection. We also need to add a color for the social network icon, or some other approach to setting the color of it while enabling theming.
224224

225-
## Require successful deployment to merge on GitHub
226-
227-
In branch protection / ruleset for main, add this required status check:
228-
Deployment / Deploy Preview to Vercel
229-
230-
## Display a system font until font files load (Lighthouse improvements)
231-
232-
Display a system font until font files load to improve FCP (First Contentful Paint) with `font-display: swap`. Need to make sure that web font doesn't render larger or smaller than the system font fallback to avoid CLS (Cumulative Layout Shift) issues.
233-
234-
```css
235-
@font-face {
236-
font-family: 'Pacifico';
237-
font-style: normal;
238-
font-weight: 400;
239-
src: local('Pacifico Regular'), local('Pacifico-Regular'),
240-
url(https://fonts.gstatic.com/s/pacifico/v12/FwZY7-Qmy14u9lezJ-6H6MmBp0u-.woff2) format('woff2');
241-
font-display: swap;
242-
}
243-
```
244-
245-
Preload fonts:
225+
## Preload fonts:
246226

247227
```html
248228
<link rel="preload" as="font" />

0 commit comments

Comments
 (0)