Skip to content

Commit 7a3afc9

Browse files
committed
Update github workflow to push dist to repo
1 parent 0e1c508 commit 7a3afc9

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

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

+31-5
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:
@@ -19,11 +19,10 @@ jobs:
1919
node-version: 20
2020
cache: yarn
2121

22-
- name: Increase network timeout
23-
run: yarn config set network-timeout 300000
24-
2522
- name: Install dependencies
26-
run: yarn install --prefer-offline
23+
run: |
24+
yarn config set network-timeout 300000
25+
yarn install --prefer-offline
2726
2827
- name: Build
2928
continue-on-error: false
@@ -36,6 +35,33 @@ jobs:
3635
path: dist
3736
retention-days: 30
3837

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

0 commit comments

Comments
 (0)