Skip to content

Commit 4cb249d

Browse files
committed
fix: try this one
1 parent 2964b92 commit 4cb249d

1 file changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/pages.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
11
name: Github Pages
22

3+
# By default, runs if you push to main. keeps your deployed app in sync with main branch.
34
on:
45
push:
56
branches:
67
- main
8+
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
9+
# on:
10+
# release:
11+
# types:
12+
# - published
713

814
permissions:
9-
contents: write
15+
contents: write # for committing to gh-pages branch.
1016

1117
jobs:
1218
build-github-pages:
1319
runs-on: ubuntu-latest
1420
steps:
15-
- uses: actions/checkout@v4
16-
17-
# ✅ Properly set up Rust 1.88.0 and cargo 1.88.0
18-
- uses: actions/setup-rust@v1
19-
with:
20-
rust-version: 1.88.0
21-
22-
- name: Add wasm target
23-
run: rustup target add wasm32-unknown-unknown
24-
25-
- name: Rust Cache
21+
- uses: actions/checkout@v4 # repo checkout
22+
- name: Setup toolchain for wasm
23+
run: |
24+
rustup update stable
25+
rustup default stable
26+
rustup set profile minimal
27+
rustup target add wasm32-unknown-unknown
28+
- name: Rust Cache # cache the rust build artefacts
2629
uses: Swatinem/rust-cache@v2
27-
2830
- name: Download and install Trunk binary
2931
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
30-
31-
- name: Build
32+
- name: Build # build
33+
# Environment $public_url resolves to the github project page.
34+
# If using a user/organization page, remove the `${{ github.event.repository.name }}` part.
35+
# using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico .
36+
# this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested
37+
# relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which
38+
# will obviously return error 404 not found.
3239
run: ./trunk build --release --public-url $public_url
3340
env:
3441
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
35-
3642
- name: Deploy
3743
uses: JamesIves/github-pages-deploy-action@v4
3844
with:
3945
folder: dist
46+
# this option will not maintain any history of your previous pages deployment
47+
# set to false if you want all page build to be committed to your gh-pages branch history
4048
single-commit: true

0 commit comments

Comments
 (0)