Skip to content

Commit

Permalink
fix: update actions to deploy with wasm-pack
Browse files Browse the repository at this point in the history
  • Loading branch information
sgasse committed Oct 13, 2024
1 parent ec0e4ba commit bb7a334
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and deploy to GH pages

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:

permissions:
Expand All @@ -12,7 +12,6 @@ env:
CARGO_TERM_COLOR: always

jobs:

lint:
name: clippy
runs-on: ubuntu-latest
Expand Down Expand Up @@ -65,19 +64,21 @@ jobs:
with:
targets: wasm32-unknown-unknown

- name: Install trunk
run: |
cargo install --locked trunk
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build WASM code
run: ./build.sh

- name: Build application
run: |
trunk build --release --public-url slide-puzzle
- name: List build content
run: ls -laR

- name: List contents
run: ls -la
# The deploy action will otherwise not copy this folder.
- name: Remove .gitignore in `www/pkg`
run: rm www/pkg/.gitignore

- name: Deploy to GH pages
if: success() && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
folder: www
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/target
Cargo.lock
dist/*
7 changes: 0 additions & 7 deletions index.html

This file was deleted.

0 comments on commit bb7a334

Please sign in to comment.