Skip to content

Commit

Permalink
site: Improve definition of preview path, fix double slash on root
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto committed Nov 6, 2024
1 parent 4024a2b commit a16bacc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
env:
CI: true
SITE_PREVIEW_PATH: preview/${{ github.sha }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -37,7 +38,7 @@ jobs:
- name: Build
run: pnpm build:site
env:
BASE_NAME: /braid-design-system/preview/${{ github.sha }}
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
BRANCH_NAME: ${{ github.ref_name }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}

Expand All @@ -46,11 +47,11 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: ./site/dist
target-folder: preview/${{ github.sha }}
target-folder: ${{ env.SITE_PREVIEW_PATH }}
commit-message: Preview of `${{ github.ref_name }}`

- name: Update PR status
run: pnpm post-commit-status
env:
BASE_NAME: /braid-design-system/preview/${{ github.sha }}
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion site/src/App/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ const PreviewBranchPanel = () => {
)}
>
<MenuItemLink
href={`https://seek-oss.github.io/braid-design-system${pathname}/${hash}`}
href={`https://seek-oss.github.io/braid-design-system${pathname}${
!pathname.endsWith('/') ? '/' : ''
}${hash}`}
target="_blank"
icon={<IconNewWindow />}
>
Expand Down

0 comments on commit a16bacc

Please sign in to comment.