Skip to content

Commit 85434b8

Browse files
committed
feat: Add GitHub Pages deployment for test reports
1 parent a564980 commit 85434b8

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

.github/workflows/cypress.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ on:
66
pull_request:
77
branches: [ master ]
88

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: true
19+
920
jobs:
1021
cypress-run:
1122
runs-on: ubuntu-latest
@@ -47,4 +58,28 @@ jobs:
4758
if: always()
4859
with:
4960
name: cypress-reports
50-
path: cypress/reports
61+
path: cypress/reports
62+
63+
- name: Setup Pages
64+
if: success()
65+
uses: actions/configure-pages@v4
66+
67+
- name: Upload Pages artifact
68+
if: success()
69+
uses: actions/upload-pages-artifact@v3
70+
with:
71+
path: 'cypress/reports/html'
72+
73+
deploy:
74+
needs: cypress-run
75+
runs-on: ubuntu-latest
76+
if: github.ref == 'refs/heads/master'
77+
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
82+
steps:
83+
- name: Deploy to GitHub Pages
84+
id: deployment
85+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)