Skip to content

Commit 9d78646

Browse files
authored
Use modern GH Pages deployment
1 parent e57fc61 commit 9d78646

1 file changed

Lines changed: 23 additions & 30 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,41 @@ env:
66
on:
77
push:
88
branches: [ main ]
9-
pull_request:
10-
branches: [ main ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
1115

1216
jobs:
13-
build:
17+
deploy:
1418
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
19+
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
1723

18-
- uses: actions/cache@v4
19-
with:
20-
path: ~/.nuget/packages
21-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
22-
restore-keys: |
23-
${{ runner.os }}-nuget-
24+
steps:
25+
- uses: actions/checkout@v5
2426

2527
- name: Setup .NET
26-
uses: actions/setup-dotnet@v4
28+
uses: actions/setup-dotnet@v5
2729
with:
2830
dotnet-version: '9.0'
31+
cache: true
2932

3033
- name: Publish with .NET
31-
run: dotnet publish -c Release -p:BlazorEnableCompression=false
34+
run: dotnet publish -c Release
3235
working-directory: ./SporeCommunity.ModBrowser.Blazor
3336

34-
- name: Add 404 redirect file
35-
run: wget -P ${{ env.PUBLISH_PATH }} "https://raw.githubusercontent.com/rafgraph/spa-github-pages/gh-pages/404.html"
37+
- uses: actions/configure-pages@v5
3638

37-
- name: Add readme file
38-
run: wget -P ${{ env.PUBLISH_PATH }} "https://gist.githubusercontent.com/Kade-N/b2dece4553f9900090fe3ce271d73048/raw/README.md"
39-
40-
# - name: Rewrite base href
41-
# uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
42-
# with:
43-
# html_path: ${{ env.PUBLISH_PATH }}/index.html
44-
# base_href: /ModBrowser/
45-
46-
- name: Configure URL
47-
run: echo "mods.sporecommunity.com" > ${{ env.PUBLISH_PATH }}/CNAME
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v4
41+
with:
42+
path: ${{ env.PUBLISH_PATH }}
4843

4944
- name: Deploy to GitHub Pages
50-
uses: peaceiris/actions-gh-pages@v4
51-
with:
52-
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
publish_dir: ${{ env.PUBLISH_PATH }}
45+
id: deployment
46+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)