Skip to content

Commit

Permalink
Deploy site on snapshot publish
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto committed Nov 6, 2024
1 parent 423e0d0 commit 33cb6da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 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/${{ github.ref_name }}
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: ${{ github.ref_name }}
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/${{ github.ref_name }}
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
env:
CI: true
SITE_PREVIEW_PATH: ${{ github.ref_name }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -35,3 +36,18 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: pnpm build:site
env:
BASE_NAME: /braid-design-system/${{ env.SITE_PREVIEW_PATH }}
BRANCH_NAME: ${{ github.ref_name }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}

- name: Deploy preview site
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # 4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: ./site/dist
target-folder: ${{ env.SITE_PREVIEW_PATH }}
commit-message: Preview of `${{ github.ref_name }}`

0 comments on commit 33cb6da

Please sign in to comment.