Skip to content

Commit

Permalink
Update github workflow to push dist to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgraham committed Nov 19, 2024
1 parent f85440b commit 8b78599
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to CDN
name: Build Push Deploy

on:
push:
Expand All @@ -19,11 +19,10 @@ jobs:
node-version: 20
cache: yarn

- name: Increase network timeout
run: yarn config set network-timeout 300000

- name: Install dependencies
run: yarn install --prefer-offline
run: |
yarn config set network-timeout 300000
yarn install --prefer-offline
- name: Build
continue-on-error: false
Expand All @@ -36,6 +35,33 @@ jobs:
path: dist
retention-days: 30

push:
name: Push
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Push distribution
run: |
MSG="$(printf "Publish distribution\n[skip ci]")"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add dist/index.min.* -f
git commit -m "$MSG" --no-verify --signoff
git push origin $BRANCH_NAME
deploy:
name: Deploy
needs: build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Forge React

<a href="https://github.com/zigurous/forge-react/actions"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/zigurous/forge-react/cdn-deploy.yml" /></a>
<a href="https://github.com/zigurous/forge-react/actions"><img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/zigurous/forge-react/build-push-deploy.yml" /></a>
<a href="https://github.com/zigurous/forge-react/pkgs/npm/forge-react"><img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/zigurous/forge-react" /></a>
<a href="https://github.com/zigurous/forge-react/blob/main/LICENSE"><img alt="GitHub License" src="https://img.shields.io/github/license/zigurous/forge-react" /></a>

Expand Down

0 comments on commit 8b78599

Please sign in to comment.