From 4817365fc17daa14fafb69bdf2a6873d18648be9 Mon Sep 17 00:00:00 2001 From: Subho Date: Mon, 29 Jul 2024 12:12:23 +0530 Subject: [PATCH] deploy artifacts to github pages if test fails --- .github/workflows/format-lint-test.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/format-lint-test.yml b/.github/workflows/format-lint-test.yml index 0189aff..f55b05b 100644 --- a/.github/workflows/format-lint-test.yml +++ b/.github/workflows/format-lint-test.yml @@ -45,9 +45,29 @@ 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: + needs: test + + # 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