Skip to content

Merge pull request #7 from corradevops/layer/upgrade-docusaurus-v3 #45

Merge pull request #7 from corradevops/layer/upgrade-docusaurus-v3

Merge pull request #7 from corradevops/layer/upgrade-docusaurus-v3 #45

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
paths:
- '.github/workflows/deploy.yml'
- 'website/**'
env:
WORKDIR: website
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-${{ env.WORKDIR }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.WORKDIR }}-
- uses: actions/setup-node@v4
with:
node-version: '18.19.0'
cache: yarn
#cache-dependency-path: ${{ runner.os }}-${{ env.WORKDIR }}-${{ hashFiles('**/yarn.lock') }}
#cache-dependency-path: website/package.json
cache-dependency-path: ${{github.workspace}}/functions/package-lock.json
- name: Install dependencies
run: yarn --cwd website install --frozen-lockfile
- name: Build website
run: NODE_OPTIONS="--openssl-legacy-provider" yarn --cwd website build
# 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
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./${{ env.WORKDIR }}/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.
cname: 'corradevops.github.io'
allow_empty_commit: true
user_name: anishcorratech
user_email: [email protected]