File tree Expand file tree Collapse file tree 1 file changed +73
-0
lines changed
Expand file tree Collapse file tree 1 file changed +73
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ cypress-run :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout Repository
17+ uses : actions/checkout@v4
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v3
21+ with :
22+ node-version : 22
23+
24+ - name : Install Dependencies
25+ run : npm i
26+
27+ - name : Build App
28+ run : npm run build
29+
30+ - name : Run Cypress Tests
31+ uses : cypress-io/github-action@v6
32+ with :
33+ start : npm start
34+ wait-on : ' http://localhost:3000'
35+ browser : chrome
36+
37+ - name : Upload Cypress Artifacts
38+ if : failure()
39+ uses : actions/upload-artifact@v4
40+ with :
41+ name : cypress-artifacts
42+ path : |
43+ cypress/screenshots
44+ cypress/videos
45+
46+ deploy :
47+ needs : cypress-run
48+ runs-on : ubuntu-latest
49+
50+ steps :
51+ - name : Checkout Repository
52+ uses : actions/checkout@v3
53+
54+ - name : Setup Node.js
55+ uses : actions/setup-node@v3
56+ with :
57+ node-version : 22
58+
59+ - name : Install Dependencies
60+ run : npm i
61+
62+ - name : Build App
63+ run : npm run build
64+
65+ - name : Configure User
66+ run : |
67+ git config --global user.email "github-actions@github.com"
68+ git config --global user.name "github-actions[bot]"
69+
70+ - name : Deploy to GitHub Pages
71+ env :
72+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+ run : npx gh-pages -d build --repo https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
You can’t perform that action at this time.
0 commit comments