-
Notifications
You must be signed in to change notification settings - Fork 5
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
58 additions
and
34 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,58 @@ | ||
name: Release WASM | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
targets: x86_64-unknown-linux-gnu | ||
- name: Build | ||
run: | | ||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
wasm-pack build --target web --release --scope nbittich ./adana-script-wasm | ||
mkdir ghPages | ||
cp -r ./adana-script-wasm/pkg ghPages | ||
cp ./adana-playground/app.js ghPages | ||
cp ./adana-playground/style.css ghPages | ||
cp ./adana-playground/favicon.ico ghPages | ||
cp ./adana-playground/examples.js ghPages | ||
cp ./adana-playground/index.html ghPages | ||
- name: Upload ghPages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ghPages | ||
path: ghPages | ||
gh-pages: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download ghPages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ghPages | ||
path: "_site/" | ||
- name: Upload pages | ||
uses: actions/upload-pages-artifact@v3 | ||
- name: Deploy pages | ||
uses: actions/deploy-pages@v4 |
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