Skip to content

Commit

Permalink
update deploy preview
Browse files Browse the repository at this point in the history
Signed-off-by: Matty Stratton <[email protected]>
  • Loading branch information
mattstratton committed Mar 4, 2024
1 parent 176e802 commit 1dfff04
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: JamesIves/github-pages-deploy-action@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
folder: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
clean-exclude: pr-preview/
27 changes: 26 additions & 1 deletion .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- closed
concurrency: preview-${{ github.ref }}
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

Expand All @@ -24,4 +30,23 @@ jobs:
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build

deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- name: Install and Build
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
run: |
yarn install --frozen-lockfile
run: yarn build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build/

0 comments on commit 1dfff04

Please sign in to comment.