Skip to content

Merge pull request #33 from switchboard-xyz/update #535

Merge pull request #33 from switchboard-xyz/update

Merge pull request #33 from switchboard-xyz/update #535

Workflow file for this run

name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches: [main, docs]
paths:
[
website/**,
.github/workflows/**,
cli/**,
sdks/**,
javascript/common/**,
javascript/sbv2-scripts/**,
]
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
# Need this to build the protobuf definitions for the doc pages
- name: Install Protoc
continue-on-error: true
uses: arduino/setup-protoc@v1
- name: Install protoc-doc-gen
continue-on-error: true
shell: bash
run: |
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install global deps
run: |
npm i -g typescript ts-node tsx @types/node turbo
- name: Install sbv2-core Dependencies
run: pnpm install --frozen-lockfile
- name: Build sbv2-core
run: pnpm build
- name: Generate Protobuf JSON
working-directory: website
continue-on-error: true
run: pnpm generate:protos
- name: Build website
working-directory: website
run: pnpm run 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: ./website/public
# 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