1
- name : CI
1
+ name : Deploy
2
2
on :
3
3
push :
4
4
branches :
24
24
with :
25
25
node-version-file : ' .nvmrc'
26
26
cache : ' npm'
27
- cache-dependency-path : ${{ matrix.project }}/package-lock.json
28
27
- name : Install Dependencies
29
28
run : npm ci
30
29
- name : Run linters
50
49
with :
51
50
node-version-file : ' .nvmrc'
52
51
cache : ' npm'
53
- cache-dependency-path : ${{ matrix.project }}/package-lock.json
52
+ - name : Install Dependencies
53
+ run : npm ci --no-audit -q
54
54
- name : Run Cypress
55
55
uses : cypress-io/github-action@v6
56
56
if : matrix.project != 'react-app'
@@ -59,14 +59,15 @@ jobs:
59
59
build : npm run build -- --logLevel error
60
60
browser : ${{ matrix.browser }}
61
61
start : npm start
62
+ install : false
62
63
- name : Run Cypress
63
64
if : matrix.project == 'react-app'
64
65
uses : cypress-io/github-action@v6
65
66
with :
66
67
working-directory : ${{ matrix.project }}
67
68
start : npm run serve
68
69
browser : ${{ matrix.browser }}
69
- install : true
70
+ install : false
70
71
- uses : actions/upload-artifact@master
71
72
if : failure()
72
73
with :
94
95
with :
95
96
node-version-file : ' .nvmrc'
96
97
cache : ' npm'
97
- cache-dependency-path : ${{ matrix.project }}/package-lock.json
98
98
- name : Install Dependencies
99
99
run : npm ci
100
100
- name : Run Unit Tests
@@ -121,26 +121,37 @@ jobs:
121
121
if : ${{ (contains(needs.*.result, 'failure')) && (contains(needs.*.conclusion, 'cancelled')) && (contains(needs.*.conclusion, 'skipped')) }}
122
122
run : exit 1
123
123
# TODO: test publishing to another repo first
124
- # publish:
125
- # name: Publish
126
- # runs-on: ubuntu-latest
127
- # if: github.repository == 'romcal/romcal-examples' && !contains(github.event.head_commit.message, '[skip ci]')
128
- # needs:
129
- # - verify
130
- # steps:
131
- # - name: Build React App
132
- # working-directory: react-app
133
- # run: VITE_DAY_VARIANT=developer npm run build
134
- # - name: Deploy
135
- # uses: peaceiris/actions-gh-pages@v4
136
- # with:
137
- # deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
138
- # external_repository: romcal/romcal.github.io
139
- # publish_branch: gh-pages
140
- # publish_dir: ./build
141
- # cname: romcal.js.org
142
- # commit_message: ${{ github.event.head_commit.message }}
143
- # force_orphan: true
144
- # user_name: 'romcalproject'
145
-
146
-
124
+ publish :
125
+ name : Publish
126
+ runs-on : ubuntu-latest
127
+ if : github.repository == 'romcal/romcal-examples' && !contains(github.event.head_commit.message, '[skip ci]')
128
+ needs :
129
+ - verify
130
+ steps :
131
+ - name : Checkout
132
+ uses : actions/checkout@v4
133
+ with :
134
+ fetch-depth : 0
135
+ - name : Install Node.js
136
+ uses : actions/setup-node@v4
137
+ with :
138
+ node-version-file : ' .nvmrc'
139
+ cache : ' npm'
140
+ - name : Install Dependencies
141
+ run : npm ci
142
+ - name : Build React App
143
+ working-directory : react-app
144
+ run : VITE_DAY_VARIANT=developer npm run build
145
+ - name : Deploy
146
+ uses : peaceiris/actions-gh-pages@v4
147
+ with :
148
+ working-directory : react-app
149
+ deploy_key : ${{ secrets.DEPLOY_TOKEN }}
150
+ external_repository : romcal/romcal.github.io
151
+ publish_branch : gh-pages
152
+ publish_dir : ./build
153
+ cname : romcal.js.org
154
+ commit_message : ${{ github.event.head_commit.message }}
155
+ force_orphan : true
156
+ user_name : ' romcalproject'
157
+
0 commit comments