Skip to content

Commit

Permalink
Deploy tune-cli WASM artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Woyten committed May 15, 2024
1 parent 8c58d06 commit a2b3be9
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 63 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/build-microwave-web.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/deploy-web-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Deploy web artifacts

on:
push:
branches: [build-tune-web]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"

jobs:
create-tune-cli-web-version:
name: Create tune-cli web version

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install trunk
run: cargo install trunk
- name: Build tune-cli
run: |
cd tune-web
trunk build --release
cd ..
mkdir -p artifact
mv tune-web/dist/* artifact
- name: Upload tune-cli
uses: actions/upload-artifact@v4
with:
name: tune-cli-wasm
path: artifact
if-no-files-found: error

create-microwave-web-version:
name: Create microwave web version

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install trunk
run: cargo install trunk
- name: Build microwave
run: |
cd microwave
trunk build --release
cd ..
mkdir -p artifact
mv microwave/dist/* artifact
- name: Upload microwave
uses: actions/upload-artifact@v4
with:
name: microwave-wasm
path: artifact
if-no-files-found: error
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: artifact

deploy-github-pages:
name: Deploy microwave web version to GitHub pages

needs:
- create-tune-cli-web-version
- create-microwave-web-version

runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Download tune-cli artifact
uses: actions/download-artifact@v4
with:
name: tune-cli-wasm
path: artifact/tune-cli
- name: Download microwave artifact
uses: actions/download-artifact@v4
with:
name: microwave-wasm
path: artifact/microwave
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: artifact
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

2 changes: 0 additions & 2 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ jobs:
target: wasm32-unknown-unknown
- name: Ensure all lints pass
run: cargo clippy --workspace --target wasm32-unknown-unknown
- name: Build
run: cargo build --workspace --target wasm32-unknown-unknown

0 comments on commit a2b3be9

Please sign in to comment.