This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy GitHub Pages | ||
|
Check failure on line 1 in .github/workflows/deploy-github-pages.yml
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - published | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| concurrency: | ||
| group: github-pages | ||
| cancel-in-progress: true | ||
| env: | ||
| APP_PROJECT: src/PrompterLive.App/PrompterLive.App.csproj | ||
| PAGES_ARTIFACT_ROOT: ${{ runner.temp }}/prompterlive-pages | ||
| PAGES_BASE_PATH: /${{ github.event.repository.name }}/ | ||
| PUBLISH_ROOT: ${{ runner.temp }}/prompterlive-publish | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| global-json-file: global.json | ||
| - name: Configure GitHub Pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Publish standalone WASM app | ||
| run: > | ||
| dotnet publish | ||
| "$APP_PROJECT" | ||
| -c Release | ||
| -o "$PUBLISH_ROOT" | ||
| -p:PrompterLiveBuildNumber=${{ github.run_number }} | ||
| - name: Prepare GitHub Pages artifact | ||
| run: | | ||
| mkdir -p "$PAGES_ARTIFACT_ROOT" | ||
| cp -R "$PUBLISH_ROOT/wwwroot/." "$PAGES_ARTIFACT_ROOT/" | ||
| sed -i "s#<base href=\"/\" />#<base href=\"${PAGES_BASE_PATH}\" />#g" "$PAGES_ARTIFACT_ROOT/index.html" | ||
| cp "$PAGES_ARTIFACT_ROOT/index.html" "$PAGES_ARTIFACT_ROOT/404.html" | ||
| touch "$PAGES_ARTIFACT_ROOT/.nojekyll" | ||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: ${{ env.PAGES_ARTIFACT_ROOT }} | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||