@@ -13,40 +13,28 @@ jobs:
1313 steps :
1414 - name : Checkout the repository
1515 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16- - name : Install pnpm
17- uses : pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
18- - name : Install Node.js
19- uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
20- with :
21- node-version-file : .node-version
22- cache : pnpm
16+ - name : Install Node.js & pnpm
17+ uses : pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
2318 - name : Install dependencies
24- run : pnpm install --ignore-scripts
19+ run : pnpm ci
2520 - name : Run tests
2621 run : pnpm test
2722
28- deploy :
29- name : Deploy
23+ build :
24+ name : Build
3025 runs-on : ubuntu-latest
3126 permissions :
3227 contents : read
33- packages : write
34- id-token : write
3528 if : github.ref == 'refs/heads/main'
36- concurrency :
37- group : deploy
38- cancel-in-progress : false
3929 needs :
4030 - test
4131 steps :
4232 - name : Checkout the repository
4333 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
44- - name : Install pnpm
45- uses : pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
46- - name : Install Node.js
47- uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
48- with :
49- node-version-file : .node-version
34+ - name : Install Node.js & pnpm
35+ uses : pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
36+ - name : Install dependencies
37+ run : pnpm ci
5038 - name : Install production dependencies
5139 run : pnpm install --prod --ignore-scripts
5240 - name : Build regions
5543 run : pnpm build
5644 - name : Bundle server with production dependencies
5745 run : pnpm --filter=server --prod deploy --legacy server/dist
46+ - name : Pack build artifacts
47+ run : tar -cf dist.tar client/dist server/dist
48+ - name : Upload build artifacts
49+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
50+ with :
51+ name : dist
52+ path : dist.tar
53+ retention-days : 1
54+
55+ deploy :
56+ name : Deploy
57+ runs-on : ubuntu-latest
58+ permissions :
59+ contents : read
60+ packages : write
61+ id-token : write
62+ if : github.ref == 'refs/heads/main'
63+ concurrency :
64+ group : deploy
65+ cancel-in-progress : false
66+ needs :
67+ - build
68+ steps :
69+ - name : Checkout the repository
70+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
71+ - name : Download build artifacts
72+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
73+ with :
74+ name : dist
75+ - name : Unpack build artifacts
76+ run : tar -xf dist.tar && rm dist.tar
5877 - name : Build Docker image
5978 run : docker build -t ghcr.io/browserslist/browsersl.ist:latest .
6079 - name : Login to GitHub Container Registry
86105 | jq -r '.[] | select(.metadata.container.tags == []) | .id')
87106 if [ -n "$IDS" ]; then
88107 for ID in $IDS; do
89- echo "Deleting browsersl.ist version $ID"
108+ echo "Deleting version $ID"
90109 gh api -X DELETE "$VERSIONS/$ID" --silent
91110 done
92111 else
0 commit comments