name: Deploy svg2gcode-web on: workflow_run: branches: [master] workflows: [Build svg2gcode-web] types: [completed] env: CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v2 with: submodules: 'true' - uses: actions-rs/toolchain@v1 with: toolchain: stable target: wasm32-unknown-unknown - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-web-deploy - uses: jetli/trunk-action@v0.1.0 - uses: jetli/wasm-bindgen-action@v0.1.0 - name: Trunk build run: | cd web trunk build --release - name: Publish to GitHub Pages uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/master' with: github_token: $ publish_dir: ./web/dist