File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy demo
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ contents : read
8+
9+ concurrency :
10+ group : cad-viewer-production
11+ cancel-in-progress : false
12+
13+ jobs :
14+ deploy :
15+ name : Deploy Cloudflare Pages
16+ runs-on : ubuntu-latest
17+ timeout-minutes : 15
18+ environment :
19+ name : production
20+ url : https://cad-viewer-iys.pages.dev
21+ env :
22+ CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
23+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
24+ steps :
25+ - uses : actions/checkout@v4
26+ - uses : actions/setup-node@v4
27+ with :
28+ node-version : 22
29+ cache : npm
30+ - run : npm ci
31+ - name : Require Cloudflare deployment credentials
32+ run : |
33+ test -n "$CLOUDFLARE_API_TOKEN"
34+ test -n "$CLOUDFLARE_ACCOUNT_ID"
35+ - run : npm run build:demo
36+ - run : npx wrangler pages deploy dist-demo --project-name cad-viewer --branch main
37+ - name : Verify production endpoints
38+ run : |
39+ curl --fail --show-error --silent --retry 5 --retry-all-errors https://cad-viewer-iys.pages.dev/ > /dev/null
40+ curl --fail --show-error --silent --retry 5 --retry-all-errors https://cad-viewer-iys.pages.dev/wasm/dwg-worker.js > /dev/null
41+ curl --fail --show-error --silent --retry 5 --retry-all-errors https://cad-viewer-iys.pages.dev/wasm/libredwg-web.wasm > /dev/null
Original file line number Diff line number Diff line change 1- name : Deploy demo to Cloudflare Pages
1+ name : CI
22
33on :
4- workflow_dispatch :
54 push :
65 branches : [main]
6+ pull_request :
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+
12+ concurrency :
13+ group : ci-${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : true
715
816jobs :
9- deploy :
17+ verify :
18+ name : Verify package and demo
1019 runs-on : ubuntu-latest
20+ timeout-minutes : 15
1121 steps :
1222 - uses : actions/checkout@v4
1323 - uses : actions/setup-node@v4
1424 with :
15- node-version : 20
25+ node-version : 22
1626 cache : npm
1727 - run : npm ci
28+ - run : npm run typecheck
29+ - run : npm test
1830 - run : npm run build:demo
19- - run : npx wrangler pages deploy dist-demo --project-name cad-viewer
20- env :
21- CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
22- CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
31+ - run : npm run check:wasm
32+ - run : npm run pack:dry
33+ - uses : actions/upload-artifact@v4
34+ with :
35+ name : cad-viewer-demo-${{ github.sha }}
36+ path : dist-demo
37+ if-no-files-found : error
38+ retention-days : 7
You can’t perform that action at this time.
0 commit comments