From 0b2388e569fd81b04121a9911c053b42e68add5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=C3=A4rber?= <01mf02@gmail.com> Date: Sat, 21 Dec 2024 14:14:15 +0100 Subject: [PATCH] Reindent and use cache. --- .github/workflows/playground.yml | 51 +++++++++++++++++++------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index c5d6f8ac7..27a44b42d 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -22,23 +22,34 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install wasm-pack - shell: bash - run: | - VERSION="0.12.1" - DIR=wasm-pack-v${VERSION}-x86_64-unknown-linux-musl - wget https://github.com/rustwasm/wasm-pack/releases/download/v${VERSION}/${DIR}.tar.gz - tar xzf ${DIR}.tar.gz - mv ${DIR}/wasm-pack ~/.cargo/bin - - name: Compile - run: wasm-pack build --target web --no-typescript --no-pack --release - working-directory: jaq-play - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: 'jaq-play' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + key: cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install wasm-pack + shell: bash + run: | + VERSION="0.12.1" + DIR=wasm-pack-v${VERSION}-x86_64-unknown-linux-musl + wget https://github.com/rustwasm/wasm-pack/releases/download/v${VERSION}/${DIR}.tar.gz + tar xzf ${DIR}.tar.gz + mv ${DIR}/wasm-pack ~/.cargo/bin + + - name: Compile + run: wasm-pack build --target web --no-typescript --no-pack --release + working-directory: jaq-play + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'jaq-play' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4