Skip to content

Commit 669d131

Browse files
CristianLarafacebook-github-bot
authored andcommitted
Add workflow to test website build (#2916)
Summary: _duplicate of https://github.com/facebook/Ax/pull/3769_ Before this there was nothing stopping us from merging website-breaking changes. This wouldn't get caught until our daily cron failed to build the website. Some of these errors can be caught by just running the website locally, but others require building the prod version of the website which involves merging in (but not deleting) the docusaurus-versions branch. It's much simpler if we can automate this as a workflow at PR creation. I've configured this to run on PRs only when files directly relevant to the website build are modified (to reduce overhead for unrelated PRs). For the main branch this will be more thorough and run every time a PR is merged. Pull Request resolved: #2916 Test Plan: In facebook/Ax#3769 I previously opened a separate PR to trigger this new workflow as a test: - PR: facebook/Ax#3770 - Workflow: https://github.com/facebook/Ax/actions/runs/14938483763/job/41971282706?pr=3770 Reviewed By: saitcakmak Differential Revision: D77952640 Pulled By: CristianLara fbshipit-source-id: 26479c6a06ed36924fcaba7a9bb9279dcb296084
1 parent 02b4894 commit 669d131

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/publish_website.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ on:
1010
required: false
1111
type: boolean
1212
default: false
13+
dry_run:
14+
required: false
15+
type: boolean
16+
default: false
1317
workflow_dispatch:
18+
run_tutorials:
19+
required: true
20+
type: boolean
21+
default: false
22+
dry_run:
23+
required: true
24+
type: boolean
25+
default: false
1426

1527

1628
jobs:
@@ -70,7 +82,7 @@ jobs:
7082
sed -i "/\"$OLD_VERSION\"/d" website/versions.json
7183
fi
7284
done
73-
- if: ${{ inputs.new_version }}
85+
- if: ${{ inputs.new_version && !inputs.dry_run }}
7486
name: Create new docusaurus version
7587
run: |
7688
python3 scripts/convert_ipynb_to_mdx.py --clean
@@ -91,6 +103,7 @@ jobs:
91103
path: website/build/
92104

93105
deploy-website:
106+
if: ${{ !inputs.dry_run }}
94107
needs: build-website
95108
permissions:
96109
pages: write

.github/workflows/test_website.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test Website
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
paths:
9+
- "tutorials/**"
10+
- "notebooks_community/**"
11+
- "docs/**"
12+
- "scripts/**"
13+
- "website/**"
14+
workflow_dispatch:
15+
16+
jobs:
17+
website:
18+
name: Test building website
19+
uses: ./.github/workflows/publish_website.yml
20+
with:
21+
dry_run: true
22+
run_tutorials: false

0 commit comments

Comments
 (0)