From f6e260e3df5bcc79bb179adedf7a9e0b7300d977 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Sat, 10 Feb 2024 14:42:40 +0100 Subject: [PATCH] hope for the best --- .github/workflows/release-wasm.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/release-wasm.yml b/.github/workflows/release-wasm.yml index eba86e0..369ee26 100644 --- a/.github/workflows/release-wasm.yml +++ b/.github/workflows/release-wasm.yml @@ -1,9 +1,15 @@ name: Release WASM +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write on: push: tags: - "**[0-9]+.[0-9]+.[0-9]+*" + workflow_dispatch: env: CARGO_TERM_COLOR: always @@ -23,11 +29,22 @@ jobs: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh wasm-pack build --target web --release --scope nbittich ./adana-script-wasm wasm-pack pack ./adana-script-wasm/pkg + mkdir ghPages + cp -r ./adana-script-wasm/pkg ghPages + cp ./adana-playground/app.js ghPages + cp ./adana-playground/examples.js ghPages + cp ./adana-playground/index.html ghPages + - name: Upload pkg uses: actions/upload-artifact@v4 with: name: pkg path: adana-script-wasm/pkg + - name: Upload ghPages + uses: actions/upload-artifact@v4 + with: + name: ghPages + path: ghPages publish: needs: build runs-on: ubuntu-latest @@ -49,3 +66,19 @@ jobs: cd pkg npm install npm publish --access public + gh-pages: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + steps: + - name: Download ghPages + uses: actions/download-artifact@v4 + with: + name: ghPages + path: "_site/" + - name: Upload pages + uses: actions/upload-pages-artifact@v3 + - name: Deploy pages + uses: actions/deploy-pages@v4