Skip to content

Commit b8d7880

Browse files
committed
Adding HTMl deployment to GH Pages.
Adds deployment of the HTML build to GH Pages.
1 parent 5f92bde commit b8d7880

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/build-pdf.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,35 @@ jobs:
8484
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
8585
if: github.event_name == 'workflow_dispatch'
8686
# This condition ensures this step only runs for workflow_dispatch events.
87+
88+
- name: Make GitHub pages directory
89+
run: |
90+
mkdir -p dist/snapshot/riscv-c-api
91+
cp build/riscv-riscv-c-api.html dist/snapshot/riscv-c-api/index.html
92+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
93+
94+
- name: Upload pages artifact
95+
uses: actions/upload-pages-artifact@v3
96+
with:
97+
path: dist
98+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
99+
100+
# Deploy HTML to Github pages.
101+
deploy:
102+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
103+
104+
needs: build
105+
106+
permissions:
107+
pages: write
108+
id-token: write
109+
110+
environment:
111+
name: github-pages
112+
url: ${{ steps.deployment.outputs.page_url }}
113+
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: Deploy to GitHub Pages
117+
id: deployment
118+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)