Skip to content

Commit

Permalink
chore(cloud-hello): Handle UI build in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
  • Loading branch information
joonas committed Jun 20, 2024
1 parent a9b3df1 commit 656ac5a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 84 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/cloud-hello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: actions/checkout@v4
- run: cargo clippy --no-deps
working-directory: cloud-hello

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -31,9 +32,40 @@ jobs:
cargo build --target wasm32-wasi
working-directory: cloud-hello
build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm install
npm run build
working-directory: cloud-hello/ui
- uses: actions/upload-artifact@v4
id: upload-cloud-hello-ui
with:
if-no-files-found: error
name: cloud-hello-ui
path: cloud-hello/ui/dist/

view-ui:
runs-on: ubuntu-latest
needs:
- build-ui
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cloud-hello-ui
path: cloud-hello/ui/dist

- run: |
ls -lahR cloud-hello/ui
release:
runs-on: ubuntu-latest
needs: [build]
needs:
- build
- build-ui
if: startsWith(github.ref, 'refs/tags/cloud-hello-v')
permissions:
contents: read
Expand All @@ -53,7 +85,12 @@ jobs:
- run: rustup target add wasm32-wasi
- uses: taiki-e/install-action@v2
with:
tool: wash-cli@0.27
tool: wash-cli@0.29.2

- uses: actions/download-artifact@v4
with:
name: cloud-hello-ui
path: cloud-hello/ui/dist

- name: Build and push
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/dist/
/target
**target
cloud-hello/ui/dist/

## File system
.DS_Store
Expand Down
1 change: 0 additions & 1 deletion cloud-hello/ui/dist/assets/index-BrwVprff.css

This file was deleted.

26 changes: 0 additions & 26 deletions cloud-hello/ui/dist/assets/index-CbmWcr-v.js

This file was deleted.

Loading

0 comments on commit 656ac5a

Please sign in to comment.