testing workflows for ci
This commit is contained in:
parent
fcb2bd2815
commit
9afb57badd
1 changed files with 34 additions and 0 deletions
34
.github/workflows/deploy wasm to gh-pages.yml
vendored
Normal file
34
.github/workflows/deploy wasm to gh-pages.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
on: push
|
||||||
|
name: Build and deploy web page with WASM version
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
steps:
|
||||||
|
- name: Checkout project
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
target: wasm32-unknown-unknown
|
||||||
|
override: true
|
||||||
|
- name: Build and deploy WASM binary
|
||||||
|
run: |
|
||||||
|
cargo build --release --target wasm32-unknown-unknown
|
||||||
|
wasm-bindgen target\wasm32-unknown-unknown\release\rust-rl.wasm --out-dir wasm --no-modules --no-typescript
|
||||||
|
cp wasm\rust-rl_bg.wasm web\
|
||||||
|
cp wasm\rust-rl.js web\
|
||||||
|
- name: Publish static website
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
cd web/
|
||||||
|
git init --initial-branch=master
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
git config user.email "github-actions-bot@users.noreply.github.com"
|
||||||
|
git add .
|
||||||
|
|
||||||
|
git commit -m "Deploy ${GITHUB_REPOSITORY} to ${GITHUB_REPOSITORY}:gh-pages"
|
||||||
|
git push --force "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" master:gh-pages
|
||||||
|
echo "Deploy complete"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue