|
| 1 | +# Simple workflow for deploying static content to GitHub Pages |
| 2 | +name: Deploy static content to Pages |
| 3 | +env: |
| 4 | + PUBLISH_DIR: /Demo/ExpireStorage.Demo/bin/Release/net10.0/publish/wwwroot |
| 5 | + |
| 6 | +on: |
| 7 | + # Runs on pushes targeting the default branch for the app's folder path |
| 8 | + push: |
| 9 | + paths: |
| 10 | + - /Demo/** |
| 11 | + branches: |
| 12 | + - master |
| 13 | + |
| 14 | + # Allows you to run this workflow manually from the Actions tab |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + pages: write |
| 21 | + id-token: write |
| 22 | + |
| 23 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 24 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 25 | +concurrency: |
| 26 | + group: "pages" |
| 27 | + cancel-in-progress: false |
| 28 | + |
| 29 | +jobs: |
| 30 | + # Single deploy job since we're just deploying |
| 31 | + deploy: |
| 32 | + environment: |
| 33 | + name: github-pages |
| 34 | + url: ${{ steps.deployment.outputs.page_url }} |
| 35 | + |
| 36 | + runs-on: ubuntu-latest |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 41 | + |
| 42 | + - name: Get latest .NET SDK |
| 43 | + uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 |
| 44 | + with: |
| 45 | + dotnet-version: '10.0.x' |
| 46 | + |
| 47 | + - name: Publish app |
| 48 | + run: dotnet publish /Demo/ExpireStorage.Demo/ExpireStorage.Demo.csproj -c Release |
| 49 | + |
| 50 | + - name: Rewrite base href |
| 51 | + uses: SteveSandersonMS/ghaction-rewrite-base-href@5b54862a8831e012d4f1a8b2660894415fdde8ec # v1.1.0 |
| 52 | + with: |
| 53 | + html_path: ${{ env.PUBLISH_DIR }}/index.html |
| 54 | + base_href: /blazor-samples/ |
| 55 | + |
| 56 | + - name: Setup Pages |
| 57 | + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 |
| 58 | + |
| 59 | + - name: Upload artifact |
| 60 | + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 |
| 61 | + with: |
| 62 | + path: ${{ env.PUBLISH_DIR }} |
| 63 | + |
| 64 | + - name: Deploy to GitHub Pages |
| 65 | + id: deployment |
| 66 | + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |
0 commit comments