abinazebinoy commited on
Commit
9170d7b
·
1 Parent(s): a083c8b

ci: gate GitHub Pages deploy on the ci workflow passing

Browse files

static.yml deployed frontend/ to GitHub Pages on every push to main,
completely independent of test.yml -- a failing/broken JS file could
ship regardless of CI's result, since the two workflows never talked
to each other.

Switched the trigger from push to workflow_run against the 'ci'
workflow (matches test.yml's `name: ci`), and added an explicit
conclusion == 'success' check, so a failing test.yml run (including
the node --check step added earlier in this branch) now blocks the
Pages deploy instead of shipping it. workflow_dispatch is still
allowed through for manual deploys.

Files changed (1) hide show
  1. .github/workflows/static.yml +6 -1
.github/workflows/static.yml CHANGED
@@ -1,8 +1,10 @@
1
  name: Deploy BharatGraph Frontend
2
 
3
  on:
4
- push:
 
5
  branches: [main]
 
6
  workflow_dispatch:
7
 
8
  permissions:
@@ -16,6 +18,9 @@ concurrency:
16
 
17
  jobs:
18
  deploy:
 
 
 
19
  environment:
20
  name: github-pages
21
  url: ${{ steps.deployment.outputs.page_url }}
 
1
  name: Deploy BharatGraph Frontend
2
 
3
  on:
4
+ workflow_run:
5
+ workflows: ["ci"]
6
  branches: [main]
7
+ types: [completed]
8
  workflow_dispatch:
9
 
10
  permissions:
 
18
 
19
  jobs:
20
  deploy:
21
+ if: >
22
+ github.event_name == 'workflow_dispatch' ||
23
+ github.event.workflow_run.conclusion == 'success'
24
  environment:
25
  name: github-pages
26
  url: ${{ steps.deployment.outputs.page_url }}