Skip to content

Commit 4b138fc

Browse files
committed
Deploy the site in a later job so Pages can see the artifact.
upload-pages-artifact and deploy-pages in one job race the artifact listing.
1 parent c248873 commit 4b138fc

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎.github/workflows/pages.yml‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
deploy:
18+
build:
1919
runs-on: ubuntu-latest
20-
environment:
21-
name: github-pages
22-
url: ${{ steps.deploy.outputs.page_url }}
2320
steps:
2421
- uses: actions/checkout@v4
2522
- uses: actions/setup-node@v4
@@ -38,5 +35,15 @@ jobs:
3835
- uses: actions/upload-pages-artifact@v3
3936
with:
4037
path: _site
38+
39+
# Deploy in a later job. upload-pages-artifact and deploy-pages in one job
40+
# race: the artifact is finalized, then the lookup still sees zero artifacts.
41+
deploy:
42+
needs: build
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deploy.outputs.page_url }}
47+
steps:
4148
- id: deploy
4249
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)