Skip to content

Commit

Permalink
Ci/gh pages (#2)
Browse files Browse the repository at this point in the history
Create action for building pages artifact
  • Loading branch information
littlebenlittle authored Jun 7, 2024
1 parent 646e0db commit 98a4164
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: github-pages
run-name: GitHub Pages
on:
pull_request:
# TODO switch to main
branches: [feature/dry-demo]
branches: [main]
types:
- closed
push:
branches: [ci/gh-pages]

jobs:

build-ui:
name: Build UI
if: github.event.pull_request.merged == true
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -38,26 +40,26 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }}
- name: Install wasm32-unknown-unknown Target
if: steps.cache-dist.outputs.cache-hit != 'true'
run: rustup target add wasm32-unknown-unknown
- name: Install Trunk
if: steps.cache-dist.outputs.cache-hit != 'true'
uses: jetli/[email protected]
- name: Build UI
if: steps.cache-dist.outputs.cache-hit != 'true'
run: trunk --verbose build --release --features demo

build-pages:
name: Build Pages
needs: build-ui
runs-on: ubuntu-latest
steps:
run: |
trunk --verbose build --release --features demo
- name: Upload Pages Artifact
if: github.ref_name == 'main'
uses: actions/upload-pages-artifact@v3
with:
path: ui/dist/

deploy-pages:
name: Deploy Pages
needs: build
if: github.ref_name == 'main'
needs: build-ui
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit 98a4164

Please sign in to comment.