-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build React | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build website | ||
run: pnpm run build | ||
|
||
- name: Compress build files | ||
run: zip -r build.zip dist | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build.zip | ||
path: build.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,30 @@ | ||
name: Build React | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build website | ||
run: pnpm run build | ||
|
||
- name: Compress build files | ||
run: zip -r build.zip dist | ||
name: build.zip | ||
|
||
- name: Upload ZIP to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload Artifacts to GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./build.zip | ||
asset_name: build.zip | ||
asset_content_type: application/zip | ||
artifacts: build.zip | ||
allowUpdates: true | ||
omitBodyDuringUpdate: true | ||
omitDraftDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true |