From 4f138b7435085e9e0f42a1714d3ef7d3338641cf Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:07:23 -0400 Subject: [PATCH 01/20] wip: deploy preview site for PRs, to make contributing easier --- .github/workflows/preview.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..d89a46ef --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,22 @@ +name: Deploy preview + +on: + pull_request: + +jobs: + build-and-deploy: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install and Build + run: | + npm install + npm run build + + - name: Deploy + uses: shlinkio/deploy-preview-action@v1.0.1 + with: + branch: main # The branch from where the GitHub Pages are served (defaults to preview-env) + folder: build # The folder where the artifacts to publish are (defaults to the project root) + From db437717cbe85432d16dbdd9e32bb3050cbf451e Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:11:17 -0400 Subject: [PATCH 02/20] fix: correct folder where astro build is located --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index d89a46ef..0633a356 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -18,5 +18,5 @@ jobs: uses: shlinkio/deploy-preview-action@v1.0.1 with: branch: main # The branch from where the GitHub Pages are served (defaults to preview-env) - folder: build # The folder where the artifacts to publish are (defaults to the project root) + folder: dist # The folder where the artifacts to publish are (defaults to the project root) From 9187549f034dcb8f0dab7b12856666032db14b65 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:14:58 -0400 Subject: [PATCH 03/20] fix: increase permissions for pull requests --- .github/workflows/preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0633a356..7a4b24b9 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -6,6 +6,8 @@ on: jobs: build-and-deploy: runs-on: ubuntu-20.04 + permissions: + pull-requests: write steps: - name: Checkout uses: actions/checkout@v2 From 9818f72427d91d3ddf2290cff36bc385e0cad1d4 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:25:06 -0400 Subject: [PATCH 04/20] wip: trying a different base github action - previous was deprecated --- .github/workflows/preview.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 7a4b24b9..21df0a17 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,24 +1,29 @@ -name: Deploy preview +name: Deploy PR previews on: pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} jobs: - build-and-deploy: + deploy-preview: runs-on: ubuntu-20.04 - permissions: - pull-requests: write steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Install and Build + if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed run: | npm install npm run build - - name: Deploy - uses: shlinkio/deploy-preview-action@v1.0.1 + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 with: - branch: main # The branch from where the GitHub Pages are served (defaults to preview-env) - folder: dist # The folder where the artifacts to publish are (defaults to the project root) - + source-dir: ./dist/ From 50cd9caa5e7e1c1c735e877df3c014b84cb0abcd Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:32:21 -0400 Subject: [PATCH 05/20] wip: adds additional configuration to deploy preview action --- .github/workflows/preview.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 21df0a17..190a2f68 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -13,6 +13,8 @@ concurrency: preview-${{ github.ref }} jobs: deploy-preview: runs-on: ubuntu-20.04 + permissions: + pull-requests: write steps: - name: Checkout uses: actions/checkout@v4 @@ -27,3 +29,4 @@ jobs: uses: rossjrw/pr-preview-action@v1 with: source-dir: ./dist/ + preview-branch: main From 79478a5eaaacf7f612bef3147d2470fcb7e817c6 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:07:42 -0400 Subject: [PATCH 06/20] wip: attempt to add github action for preview deploy Following https://github.com/rossjrw/pr-preview-action --- .github/actions/determine-auto-action.sh | 28 ++++++ .github/workflows/preview.yml | 103 ++++++++++++++++++++--- 2 files changed, 119 insertions(+), 12 deletions(-) create mode 100644 .github/actions/determine-auto-action.sh diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh new file mode 100644 index 00000000..eaf858bd --- /dev/null +++ b/.github/actions/determine-auto-action.sh @@ -0,0 +1,28 @@ +# from https://github.com/rossjrw/pr-preview-action/blob/main/lib/determine-auto-action.sh + +case $GITHUB_EVENT_NAME in + "pull_request" | "pull_request_target") + echo "event_name is $GITHUB_EVENT_NAME; proceeding" + ;; + *) + echo "unknown event $GITHUB_EVENT_NAME; no action to take" + echo "action=none" >> "$GITHUB_ENV" + exit 0 + ;; +esac + +event_type=$(jq -r ".action" "$GITHUB_EVENT_PATH") +echo "event_type is $event_type" + +case $event_type in + "opened" | "reopened" | "synchronize") + echo "action=deploy" >> "$GITHUB_ENV" + ;; + "closed") + echo "action=remove" >> "$GITHUB_ENV" + ;; + *) + echo "unknown event type $event_type; no action to take" + echo "action=none" >> "$GITHUB_ENV" + ;; +esac \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 190a2f68..0e8f5af0 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,6 +1,7 @@ name: Deploy PR previews on: + workflow_dispatch: pull_request: types: - opened @@ -8,25 +9,103 @@ on: - synchronize - closed +permissions: + contents: read + pages: write + id-token: write + concurrency: preview-${{ github.ref }} +env: + INPUT_PATH: "." + PREVIEW_PATH: pr-preview # subfolder + OSSI_SITE_TOKEN: ${{ secrets.GITHUB_TOKEN }} + action: auto + preview-branch: main + pr: ${{ github.event.number }} + actionref: ${{ github.action_ref }} + actionrepo: ${{ github.action_repository }} + deployrepo: ${{ github.repository }} + jobs: - deploy-preview: - runs-on: ubuntu-20.04 - permissions: - pull-requests: write + build: + runs-on: ubuntu-latest + steps: + - name: Store environment variables + run: | + org=$(echo "${{env.deployrepo}}" | cut -d "/" -f 1) + thirdleveldomain=$(echo "${{env.deployrepo}}" | cut -d "/" -f 2) + + if [ "${org}.github.io" == "$thirdleveldomain" ]; then + pagesurl="${org}.github.io" + else + pagesurl=$(echo "${{env.deployrepo}}" | sed 's/\//.github.io\//') + fi + echo "pagesurl=$pagesurl" >> $GITHUB_ENV + echo "targetdir=${{PREVIEW_PATH}}/pr-$pr" >> $GITHUB_ENV + echo "emptydir=$(mktemp -d)" >> $GITHUB_ENV + echo "datetime=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV + + - name: Determine auto action + run: .github/actions/determine-auto-action.sh + - name: Checkout uses: actions/checkout@v4 - - name: Install and Build - if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: npm + cache-dependency-path: ${{ env.INPUT_PATH }}/package-lock.json + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: npm ci + working-directory: ${{ env.INPUT_PATH }} + - name: Build with Astro run: | - npm install - npm run build + npx --no-install astro build \ + --site "https://${{ env.pagesurl }}" \ + --base "${{ env.PREVIEW_PATH }}" + working-directory: ${{ env.INPUT_PATH}} + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ env.PREVIEW_PATH }}/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 - - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 + comment: + needs: deploy + runs-on: ubuntu-latest + steps: + - name: Expose deployment URL + id: url + run: echo "url=https://${{ env.pagesurl }}/${{ env.targetdir }}/" >> $GITHUB_OUTPUT + shell: bash + + - name: Leave a comment after deployment + uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0 with: - source-dir: ./dist/ - preview-branch: main + header: pr-preview + message: " + :rocket: Deployed preview to + https://${{ env.pagesurl }}/${{ env.targetdir }}/ + + on branch [`${{ env.preview-branch }}`](\ + ${{ github.server_url }}/${{ env.deployrepo }}\ + /tree/${{ env.preview-branch }}) + at ${{ env.datetime }} + " From cef7f8d86f0a7eb5743d5c04936bd844585b3aee Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:08:47 -0400 Subject: [PATCH 07/20] fix: invalid path name --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0e8f5af0..b4811f78 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -43,7 +43,7 @@ jobs: pagesurl=$(echo "${{env.deployrepo}}" | sed 's/\//.github.io\//') fi echo "pagesurl=$pagesurl" >> $GITHUB_ENV - echo "targetdir=${{PREVIEW_PATH}}/pr-$pr" >> $GITHUB_ENV + echo "targetdir=${{env.PREVIEW_PATH}}/pr-$pr" >> $GITHUB_ENV echo "emptydir=$(mktemp -d)" >> $GITHUB_ENV echo "datetime=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV From 7a7f5ea3d5a4e8414db16db1fe9dcc20fe21d890 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:10:44 -0400 Subject: [PATCH 08/20] fix: move checkout before attempting to access shell script --- .github/workflows/preview.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b4811f78..f5cc9cd5 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -47,12 +47,12 @@ jobs: echo "emptydir=$(mktemp -d)" >> $GITHUB_ENV echo "datetime=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV - - name: Determine auto action - run: .github/actions/determine-auto-action.sh - - name: Checkout uses: actions/checkout@v4 + - name: Determine auto action + run: .github/actions/determine-auto-action.sh + - name: Setup Node uses: actions/setup-node@v4 with: From d4cab6bb233c8b4c474d06e641625a8e1331d5bc Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:14:33 -0400 Subject: [PATCH 09/20] fix: make the shell script executable https://aileenrae.co.uk/blog/github-actions-shell-script-permission-denied-error/ --- .github/actions/determine-auto-action.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh index eaf858bd..6f7cc960 100644 --- a/.github/actions/determine-auto-action.sh +++ b/.github/actions/determine-auto-action.sh @@ -1,4 +1,4 @@ -# from https://github.com/rossjrw/pr-preview-action/blob/main/lib/determine-auto-action.sh +# Script copied from https://github.com/rossjrw/pr-preview-action/blob/main/lib/determine-auto-action.sh case $GITHUB_EVENT_NAME in "pull_request" | "pull_request_target") From 846527bed1f2fbf0c512978644b33b10050e7ae5 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:16:42 -0400 Subject: [PATCH 10/20] fix: attempted again to add executable to shell script git push --- .github/actions/determine-auto-action.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/actions/determine-auto-action.sh diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh old mode 100644 new mode 100755 From 0224f4c312051f54764141bd7002d679e056d801 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:56:17 -0400 Subject: [PATCH 11/20] wip: changing to a different build action --- .github/actions/determine-auto-action.sh | 0 .github/workflows/preview.yml | 28 +++++++++--------------- 2 files changed, 10 insertions(+), 18 deletions(-) mode change 100755 => 100644 .github/actions/determine-auto-action.sh diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh old mode 100755 new mode 100644 diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index f5cc9cd5..5f9e2717 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -71,26 +71,18 @@ jobs: --site "https://${{ env.pagesurl }}" \ --base "${{ env.PREVIEW_PATH }}" working-directory: ${{ env.INPUT_PATH}} - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ${{ env.PREVIEW_PATH }}/dist - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - needs: build - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Deploy preview directory + if: env.action == 'deploy' + uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e # v4.5.0 + with: + repository-name: ${{ env.deployrepo }} + branch: ${{ env.preview-branch }} + folder: dist + target-folder: ${{ env.targetdir }} + commit-message: Deploy preview for PR ${{ env.pr }} 🛫 + force: false - comment: - needs: deploy - runs-on: ubuntu-latest - steps: - name: Expose deployment URL id: url run: echo "url=https://${{ env.pagesurl }}/${{ env.targetdir }}/" >> $GITHUB_OUTPUT From c0a4aa6ce8b32207c7cbb06289645de59639eefa Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:58:00 -0400 Subject: [PATCH 12/20] fix: making shell script executable - again? --- .github/actions/determine-auto-action.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/actions/determine-auto-action.sh diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh old mode 100644 new mode 100755 From a1eb6722baebb6c77b7f8d72863f2a2fa71e4ef7 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:01:59 -0400 Subject: [PATCH 13/20] fix: add write permissions for pull request to enable commenting --- .github/actions/determine-auto-action.sh | 0 .github/workflows/preview.yml | 1 + 2 files changed, 1 insertion(+) mode change 100755 => 100644 .github/actions/determine-auto-action.sh diff --git a/.github/actions/determine-auto-action.sh b/.github/actions/determine-auto-action.sh old mode 100755 new mode 100644 diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5f9e2717..aa876ff0 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -13,6 +13,7 @@ permissions: contents: read pages: write id-token: write + pull-requests: write concurrency: preview-${{ github.ref }} From 6a50377e5e1af83b16d959071f143191298e7aa2 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:03:53 -0400 Subject: [PATCH 14/20] fix: adding bash to attempt to execute shell script on each run --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index aa876ff0..cf3289fe 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -52,7 +52,7 @@ jobs: uses: actions/checkout@v4 - name: Determine auto action - run: .github/actions/determine-auto-action.sh + run: bash .github/actions/determine-auto-action.sh - name: Setup Node uses: actions/setup-node@v4 From ffea861293a60051762009b7309d7af490dbfe69 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:34:54 -0400 Subject: [PATCH 15/20] wip: going back to uploading a pages artifact to deploy --- .github/workflows/preview.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index cf3289fe..605737cb 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -60,6 +60,7 @@ jobs: node-version: "20" cache: npm cache-dependency-path: ${{ env.INPUT_PATH }}/package-lock.json + - name: Setup Pages id: pages uses: actions/configure-pages@v4 @@ -73,16 +74,22 @@ jobs: --base "${{ env.PREVIEW_PATH }}" working-directory: ${{ env.INPUT_PATH}} - - name: Deploy preview directory - if: env.action == 'deploy' - uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e # v4.5.0 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - repository-name: ${{ env.deployrepo }} - branch: ${{ env.preview-branch }} - folder: dist - target-folder: ${{ env.targetdir }} - commit-message: Deploy preview for PR ${{ env.pr }} 🛫 - force: false + path: ${{ env.INPUT_PATH }}/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 - name: Expose deployment URL id: url From 13dcdfcd2963bb945ca507ead5319af0a7e94f49 Mon Sep 17 00:00:00 2001 From: Allison Truhlar <114596142+allison-truhlar@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:59:58 -0400 Subject: [PATCH 16/20] wip: adding a preview_path env variable to the baseurl --- .github/workflows/preview.yml | 15 +++++++++------ src/components/Footer.astro | 8 ++++++-- src/components/Header.astro | 5 ++++- src/data/navigation.js | 11 +++++++---- src/pages/index.astro | 11 +++++++---- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 605737cb..958fb58e 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -2,7 +2,8 @@ name: Deploy PR previews on: workflow_dispatch: - pull_request: + pull_request_target: + branches: main types: - opened - reopened @@ -19,11 +20,11 @@ concurrency: preview-${{ github.ref }} env: INPUT_PATH: "." - PREVIEW_PATH: pr-preview # subfolder + PREVIEW_FOLDER: "/pr-preview" # subfolder + pr: ${{ github.event.number }} OSSI_SITE_TOKEN: ${{ secrets.GITHUB_TOKEN }} action: auto preview-branch: main - pr: ${{ github.event.number }} actionref: ${{ github.action_ref }} actionrepo: ${{ github.action_repository }} deployrepo: ${{ github.repository }} @@ -44,7 +45,7 @@ jobs: pagesurl=$(echo "${{env.deployrepo}}" | sed 's/\//.github.io\//') fi echo "pagesurl=$pagesurl" >> $GITHUB_ENV - echo "targetdir=${{env.PREVIEW_PATH}}/pr-$pr" >> $GITHUB_ENV + echo "PREVIEW_PATH=${{env.PREVIEW_FOLDER}}/pr-${{env.pr}}" >> $GITHUB_ENV echo "emptydir=$(mktemp -d)" >> $GITHUB_ENV echo "datetime=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV @@ -64,9 +65,11 @@ jobs: - name: Setup Pages id: pages uses: actions/configure-pages@v4 + - name: Install dependencies run: npm ci working-directory: ${{ env.INPUT_PATH }} + - name: Build with Astro run: | npx --no-install astro build \ @@ -93,7 +96,7 @@ jobs: - name: Expose deployment URL id: url - run: echo "url=https://${{ env.pagesurl }}/${{ env.targetdir }}/" >> $GITHUB_OUTPUT + run: echo "url=https://${{ env.pagesurl }}/${{ env.PREVIEW_PATH }}/" >> $GITHUB_OUTPUT shell: bash - name: Leave a comment after deployment @@ -102,7 +105,7 @@ jobs: header: pr-preview message: " :rocket: Deployed preview to - https://${{ env.pagesurl }}/${{ env.targetdir }}/ + https://${{ env.pagesurl }}/${{ env.PREVIEW_PATH }}/ on branch [`${{ env.preview-branch }}`](\ ${{ github.server_url }}/${{ env.deployrepo }}\ diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 465f826e..2897449d 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -5,6 +5,9 @@ import janeliaLogoBlack from "../assets/images/HHMI_Janelia_Logo-Black.png"; import janeliaLogoWhite from "../assets/images/HHMI_Janelia_Logo-White.png"; const baseUrl = import.meta.env.BASE_URL; +const previewPath = import.meta.env.PREVIEW_PATH + ? import.meta.env.PREVIEW_PATH + : ""; ---