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 - 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') }} restore-keys: | cargo-${{ runner.os }}- - uses: jetli/trunk-action@v0.1.0 - uses: jetli/wasm-bindgen-action@v0.1.0 - run: | cd web trunk build --release - uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/main' with: github_token: $ publish_dir: ./web/dist