Skip to content

Commit 7ead567

Browse files
committed
Enhance GitHub Actions workflow for GitHub Pages deployment
- Added a new deploy job to the workflow for deploying to GitHub Pages, ensuring streamlined publication of benchmark artifacts. - Updated permissions to include `pages` and `id-token` for improved access control during deployment. - Replaced the previous benchmark report publishing step with an upload artifact action for better artifact management.
1 parent 3ad3589 commit 7ead567

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313

1414
permissions:
1515
contents: write
16+
pages: write
17+
id-token: write
1618

1719
jobs:
1820
release:
@@ -38,17 +40,16 @@ jobs:
3840
with:
3941
source: ./docs
4042
destination: ./_site
41-
- name: Prepare gh-pages publish directory
43+
- name: Stage benchmark artifacts for Pages
4244
run: |
4345
mkdir -p _site/benchmarks/${RELEASE_TAG}
4446
mkdir -p _site/benchmarks/latest
4547
cp -R target/criterion/. _site/benchmarks/${RELEASE_TAG}/
4648
cp -R target/criterion/. _site/benchmarks/latest/
47-
- name: Publish benchmark report to gh-pages
48-
uses: peaceiris/actions-gh-pages@v4
49+
- name: Upload GitHub Pages artifact
50+
uses: actions/upload-pages-artifact@v3
4951
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: _site
52+
path: _site
5253
- name: Create release for tag push
5354
if: github.event_name == 'push'
5455
uses: softprops/action-gh-release@v2
@@ -63,3 +64,18 @@ jobs:
6364
tag_name: ${{ inputs.tag }}
6465
generate_release_notes: true
6566
files: criterion-results.tar.gz
67+
68+
deploy:
69+
name: Deploy GitHub Pages
70+
runs-on: ubuntu-latest
71+
needs: release
72+
permissions:
73+
pages: write
74+
id-token: write
75+
environment:
76+
name: github-pages
77+
url: ${{ steps.deployment.outputs.page_url }}
78+
steps:
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)