Skip to content

Commit

Permalink
ci: switched to docusaurus check and deploy workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Sep 18, 2023
1 parent 616fa53 commit 9b18360
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 38 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# This check-docs workflow was created based on instructions from:
# https://docusaurus.io/docs/deployment
name: Check docs build
# This workflow runs when a PR is labeled with `docs`
# This will check if the docs build successfully by running `npm run build`
on:
pull_request:
branches:
- main
paths:
- './docs'

jobs:
check-docs-build:
if: ${{ github.event.label.name == 'docs' }}

name: Check docs build
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
persist-credentials: false
fetch-depth: 0
node-version: 18
cache: npm

- name: Install dependencies and build docs 🧱
run: |
cd docs
npm install
npm run build
- name: Install dependencies
run: npm ci
- name: Test build website
run: npm run build
48 changes: 21 additions & 27 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
name: Deploy docs
# This job builds and deploys documenation to github pages.
# It runs on every push to main with a change in the docs folder.
# This deploy-docs workflow was created based on instructions from:
# https://docusaurus.io/docs/deployment
name: Deploy to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docs/**"
- .github/workflows/deploy-docs.yml

permissions:
contents: read

jobs:
build-and-deploy:
permissions:
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
container:
image: ghcr.io/cosmos/website-deployment
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
ref: "main"
persist-credentials: false
fetch-depth: 0
path: "."
node-version: 18
cache: npm

- name: Build 🔧
run: |
git config --global --add safe.directory /__w/ibc-go/ibc-go
make build-docs LEDGER_ENABLED=false
- name: Install dependencies
run: npm ci
- name: Build website
run: npm run build

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.3
# 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:
branch: gh-pages
folder: ~/output
single-commit: true
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build

0 comments on commit 9b18360

Please sign in to comment.