Skip to content

Commit

Permalink
Add dependency to build job and grant necessary permissions for Pages…
Browse files Browse the repository at this point in the history
… deployment
  • Loading branch information
Raj committed Dec 22, 2023
1 parent 178809b commit 145b34a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/blazor-client-helloworld-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,27 @@ jobs:
path: ${{ env.PUBLISH_DIR }}

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: published-app
path: ./published-app
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
actions: read # to download an artifact uploaded by `actions/upload-pages-artifact@v3`

# Deploy to the github-pages environment
environment:
name: github-pages

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: published-app

- name: Update environment
run: echo "PAGE_URL=https://${{ github.repository_owner }}.github.io/${{ github.repository }}" >> $GITHUB_ENV

0 comments on commit 145b34a

Please sign in to comment.