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