Merge pull request #63 from arkade-os/agent/update-vm-opcodes #34
This file contains hidden or 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
| name: Deploy Playground to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install wasm-pack | |
| uses: jetli/wasm-pack-action@v0.4.0 | |
| with: | |
| version: 'latest' | |
| - name: Generate contracts.js | |
| run: ./playground/generate_contracts.sh | |
| - name: Build WASM package | |
| run: wasm-pack build --target web --out-dir playground/pkg -- --features wasm | |
| - name: Clean up WASM package artifacts | |
| run: | | |
| rm -f playground/pkg/.gitignore | |
| rm -f playground/pkg/package.json | |
| rm -f playground/pkg/README.md | |
| - name: Remove playground .gitignore so generated files are included | |
| run: rm playground/.gitignore | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: playground | |
| target-folder: . | |
| clean: true | |
| clean-exclude: | | |
| pr-previews/ |