Skip to content

Commit 2fa1938

Browse files
committed
Update release job to use upload-pages-artifact
1 parent 1494671 commit 2fa1938

1 file changed

Lines changed: 31 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
push:
77
branches: ["main"]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
name: Build and Test
@@ -27,7 +30,7 @@ jobs:
2730
run: echo "${{ github.event.pull_request.number }}" > pr_number.txt
2831
- name: Upload site artifact
2932
if: github.event_name == 'pull_request'
30-
uses: actions/upload-artifact@v4
33+
uses: actions/upload-artifact@v7
3134
with:
3235
name: site
3336
path: target
@@ -41,10 +44,32 @@ jobs:
4144
path: pr_number.txt
4245
if-no-files-found: error
4346
retention-days: 30
44-
- name: Publish to GitHub Pages
47+
- name: Add CNAME for custom domain
4548
if: github.event_name == 'push'
46-
uses: peaceiris/actions-gh-pages@v4.0.0
49+
run: echo "typelevel.org" > target/CNAME
50+
- name: Upload GitHub Pages artifact
51+
if: github.event_name == 'push'
52+
uses: actions/upload-pages-artifact@v5
4753
with:
48-
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: target
50-
cname: typelevel.org
54+
path: target
55+
# we need to include the .well-known directory
56+
include-hidden-files: true
57+
58+
deploy:
59+
name: Deploy to GitHub Pages
60+
if: github.event_name == 'push'
61+
needs: build
62+
runs-on: ubuntu-latest
63+
concurrency:
64+
group: "pages"
65+
cancel-in-progress: false
66+
permissions:
67+
pages: write
68+
id-token: write
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
steps:
73+
- name: Deploy to GitHub Pages
74+
id: deployment
75+
uses: actions/deploy-pages@v5

0 commit comments

Comments
 (0)