Skip to content

Commit a4fa906

Browse files
committed
ci: add github pages deployment for main branch
deploy to github pages when pushing to main, similar to ipfs/specs setup
1 parent bb3d833 commit a4fa906

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This workflow has access to secrets but never executes untrusted code
33
# It only downloads and deploys pre-built artifacts from the build workflow
44
# Security: Fork code cannot access secrets as it only runs in build workflow
5-
# Deploys to IPFS for all branches
5+
# Deploys to IPFS for all branches and GitHub Pages for main branch only
66

77
name: Deploy
88

@@ -51,4 +51,33 @@ jobs:
5151
storacha-proof: ${{ secrets.STORACHA_PROOF }}
5252
github-token: ${{ github.token }}
5353
retention-count: 10
54-
retention-days: 30
54+
retention-days: 30
55+
56+
deploy-gh-pages:
57+
if: |
58+
github.event.workflow_run.conclusion == 'success' &&
59+
github.event.workflow_run.head_branch == 'main'
60+
runs-on: ubuntu-latest
61+
permissions:
62+
pages: write
63+
id-token: write
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
steps:
68+
- name: Download build artifact
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: docs-build-${{ github.event.workflow_run.id }}
72+
path: docs-build
73+
run-id: ${{ github.event.workflow_run.id }}
74+
github-token: ${{ github.token }}
75+
76+
- name: Upload Pages artifact
77+
uses: actions/upload-pages-artifact@v3
78+
with:
79+
path: docs-build
80+
81+
- name: Deploy to GitHub Pages
82+
id: deployment
83+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)