Skip to content

Commit 117aa21

Browse files
committed
Update github workflow to push dist to repo
1 parent 0e1c508 commit 117aa21

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/cdn-deploy.yml .github/workflows/build-push-deploy.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to CDN
1+
name: Build Push Deploy
22

33
on:
44
push:
@@ -7,7 +7,6 @@ on:
77

88
jobs:
99
build:
10-
name: Build
1110
runs-on: ubuntu-latest
1211
steps:
1312
- name: Checkout
@@ -19,11 +18,10 @@ jobs:
1918
node-version: 20
2019
cache: yarn
2120

22-
- name: Increase network timeout
23-
run: yarn config set network-timeout 300000
24-
2521
- name: Install dependencies
26-
run: yarn install --prefer-offline
22+
run: |
23+
yarn config set network-timeout 300000
24+
yarn install --prefer-offline
2725
2826
- name: Build
2927
continue-on-error: false
@@ -36,8 +34,33 @@ jobs:
3634
path: dist
3735
retention-days: 30
3836

37+
push:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write
42+
env:
43+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
48+
- name: Download artifact
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: dist
52+
path: dist
53+
54+
- name: Push distribution
55+
run: |
56+
MSG="$(printf "Publish distribution\n[skip ci]")"
57+
git config --global user.name "github-actions[bot]"
58+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
59+
git add dist -f
60+
git commit -m "$MSG" --no-verify --signoff
61+
git push origin $BRANCH_NAME
62+
3963
deploy:
40-
name: Deploy
4164
needs: build
4265
runs-on: ubuntu-latest
4366
permissions:

0 commit comments

Comments
 (0)