Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: switched to docusaurus check and deploy workflows #4688

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
47 changes: 21 additions & 26 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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:
srdtrk marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -10,33 +11,27 @@ on:
- "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/[email protected]
# 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
Loading