|
6 | 6 | on: |
7 | 7 | push: |
8 | 8 | branches: [ main ] |
9 | | - pull_request: |
10 | | - branches: [ main ] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + pages: write |
| 14 | + id-token: write |
11 | 15 |
|
12 | 16 | jobs: |
13 | | - build: |
| 17 | + deploy: |
14 | 18 | 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 }} |
17 | 23 |
|
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 |
24 | 26 |
|
25 | 27 | - name: Setup .NET |
26 | | - uses: actions/setup-dotnet@v4 |
| 28 | + uses: actions/setup-dotnet@v5 |
27 | 29 | with: |
28 | 30 | dotnet-version: '9.0' |
| 31 | + cache: true |
29 | 32 |
|
30 | 33 | - name: Publish with .NET |
31 | | - run: dotnet publish -c Release -p:BlazorEnableCompression=false |
| 34 | + run: dotnet publish -c Release |
32 | 35 | working-directory: ./SporeCommunity.ModBrowser.Blazor |
33 | 36 |
|
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 |
36 | 38 |
|
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 }} |
48 | 43 |
|
49 | 44 | - 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