Merge pull request #2091 from agriculturegovau/develop #1550
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Docs Site | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup Node.js 22.15.1 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.15.1 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build | |
run: yarn build-site | |
env: | |
# Github has a maximum RAM size of 7 GiB by default | |
# Building storybook requires extra RAM, so we are bumping the `max-old-space-size` to 6 GiB | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
NODE_OPTIONS: --max-old-space-size=6144 | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs/out # The folder the action should deploy. | |
# https://github.com/rossjrw/pr-preview-action#ensure-your-main-deployment-is-compatible | |
clean-exclude: | | |
pr-preview/ | |
develop/ | |
force: false # https://github.com/rossjrw/pr-preview-action#ensure-your-main-deployment-is-compatible |