From ef4c0e12bc099c59b8252348d9d4fff7f8fe702e Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Tue, 26 Mar 2024 17:24:31 +0100 Subject: [PATCH] Fix workflow file for page deploy (#126) This PR fixes the workflow for the page deployment using a modified public URL, as discussed in #116. This should also fix the issue that the template app is currently not loading properly. --- .github/workflows/pages.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 36d1f89f..9190f84d 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -30,12 +30,15 @@ jobs: - name: Download and install Trunk binary run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- - name: Build # build - # "${GITHUB_REPOSITORY#*/}" evaluates into the name of the repository + # Environment $public_url resolves to the github project page. + # If using a user/organization page, remove the `${{ github.event.repository.name }}` part. # using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico . # this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested # relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which # will obviously return error 404 not found. - run: ./trunk build --release --public-url "${GITHUB_REPOSITORY#*/}" + run: ./trunk build --release --public-url $public_url + env: + public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: