Skip to content

Commit

Permalink
deploy artifacts to github pages if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
subhoghoshX committed Jul 29, 2024
1 parent 5585465 commit 24affa3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/format-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,30 @@ jobs:
run: npm run test

# Upload test results on failure
- uses: actions/upload-artifact@v4
- uses: actions/upload-pages-artifact@v3
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

deploy:
if: needs.test.result == 'failure'
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

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 24affa3

Please sign in to comment.