Skip to content

Commit

Permalink
Different deployement approach in GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
heeckhau committed Apr 18, 2024
1 parent b989aa4 commit 10dbb70
Showing 1 changed file with 15 additions and 28 deletions.
43 changes: 15 additions & 28 deletions .github/workflows/yew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,7 +28,11 @@ jobs:
~/.cargo/registry
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Dump github context
run: echo "$GITHUB_CONTEXT"
shell: bash
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Install Trunk
uses: jetli/[email protected]
with:
Expand All @@ -35,33 +42,13 @@ jobs:
run: |
rustup target add wasm32-unknown-unknown
- name: Build the Rust WASM app and all of its assets
run: trunk build --public-url ${{ github.event.repository.name }} --release
run: trunk build --public-url /proof_viz --release
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/[email protected]
- name: Deploy to GitHub pages
# For main branch only 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
path: "./dist"

deploy:
needs: build # Add a dependency to the build job

# For main branch only
if: github.ref == 'refs/heads/main'

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
folder: "./dist"
clean: true

0 comments on commit 10dbb70

Please sign in to comment.