Skip to content

Commit

Permalink
Revert "Now that hosting is in vercel, we can remove redundant github…
Browse files Browse the repository at this point in the history
… pages actions"
  • Loading branch information
joshuafernandes authored Jan 24, 2024
1 parent 9a27050 commit f679ced
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish docs to GitHub Pages

on:
workflow_call:
inputs:
destination_dir:
type: string
ref:
required: false
type: string

jobs:
publish-docs-to-gh-pages:
name: Publish docs to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install npm dependencies
run: yarn --immutable
- name: Run build script
run: DEST="/${{ inputs.destination_dir }}" yarn build
- name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
destination_dir: ${{ inputs.destination_dir }}
keep_files: true

12 changes: 12 additions & 0 deletions .github/workflows/publish-main-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Publish main branch docs to GitHub Pages

on:
push:
branches: main

jobs:
publish-to-gh-pages:
name: Publish docs to `./` directory of `gh-pages` branch
permissions:
contents: write
uses: ./.github/workflows/publish-docs.yml

0 comments on commit f679ced

Please sign in to comment.