-
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
11 changed files
with
421 additions
and
191 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,33 @@ | ||
name: Setup yarn | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install specific Yarn version | ||
shell: bash | ||
run: | | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.19 | ||
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $GITHUB_PATH | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
shell: bash | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Packages | ||
shell: bash | ||
run: yarn install --frozen-lockfile && yarn --cwd ./example install --frozen-lockfile |
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,26 @@ | ||
name: Build package | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build-pkg: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js and Yarn | ||
uses: ./.github/actions/node | ||
|
||
# Not currently attempting to build WASM modules on CI | ||
|
||
- name: Build package | ||
shell: bash | ||
run: yarn build:rollup | ||
|
||
- name: Archive build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pkg-build-${{ github.run_id }} | ||
path: | | ||
example/public |
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,34 @@ | ||
name: Build website | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
website: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js and Yarn | ||
uses: ./.github/actions/node | ||
|
||
- name: Download the build artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pkg-build-${{ github.run_id }} | ||
|
||
- name: Build website | ||
shell: bash | ||
run: yarn website:build | ||
|
||
# This action uploads an artifact named `github-pages` which will be used by actions/deploy-pages | ||
- name: Upload artifact | ||
if: ${{ inputs.environment == 'production' }} | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ./example/dist |
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,18 @@ | ||
name: on pull request | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- "**/*" | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-pkg.yml | ||
|
||
website: | ||
needs: build | ||
uses: ./.github/workflows/build-website.yml | ||
with: | ||
environment: development |
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,49 @@ | ||
name: On push | ||
|
||
on: | ||
# Runs on pushes targeting the main branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build-pkg.yml | ||
|
||
website: | ||
needs: build | ||
uses: ./.github/workflows/build-website.yml | ||
with: | ||
environment: production | ||
|
||
pages: | ||
# Only deploy if the string '(website)' is in the commit message. NOTE not a RegExp | ||
if: "contains(github.event.head_commit.message, '(website)')" | ||
|
||
# Add a dependency to the build job | ||
needs: website | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
contents: read | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
# Specify runner + deployment step | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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
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,10 +1,14 @@ | ||
{ | ||
"name": "daisysp-wasm-example-website", | ||
"name": "daisysp-wasm-example", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
} | ||
}, | ||
"devDependencies": { | ||
"vite": "4.0.4" | ||
}, | ||
"type": "module" | ||
} |
Oops, something went wrong.