ci: add docs ci

This commit is contained in:
Daylin Morgan 2023-11-13 14:17:41 -06:00
parent bf06b027b2
commit ebac9e921a
Signed by: daylin
GPG Key ID: C1E52E7DD81DF79F
1 changed files with 74 additions and 0 deletions

74
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,74 @@
name: 📄 Build Docs
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: jiro4989/setup-nim-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: pnpm install
- name: Build Website
run: |
nimble install -Y 'https://github.com/nim-lang/atlas.git@#f7ade65f'
nim setup
nim build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2