Skip to content

Commit

Permalink
Updated workflow to have permissions on job level.
Browse files Browse the repository at this point in the history
Reverted back to using pages actions and added environment setting.
  • Loading branch information
harmen-xb committed Nov 17, 2023
1 parent 4fef5fd commit ba31b01
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ defaults:
run:
shell: bash

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write

jobs:
build-and-test:
name: ${{ matrix.os }}
Expand Down Expand Up @@ -114,6 +109,13 @@ jobs:
publish-playwright-test-report:
name: Publish PlayWright Test Report
needs: build-and-test
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: always()
steps:
Expand Down Expand Up @@ -143,8 +145,10 @@ jobs:
subfolder: allure
# Where to find the gh-pages history.
gh_pages: gh-pages
- name: Publish Allure Report
uses: peaceiris/actions-gh-pages@v3
with:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: allure-history

0 comments on commit ba31b01

Please sign in to comment.