Skip to content

Commit

Permalink
fix: documentation generation and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEspinas committed Aug 21, 2024
1 parent 714bf32 commit 1a69aae
Showing 1 changed file with 68 additions and 58 deletions.
126 changes: 68 additions & 58 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,73 @@ name: Documentation generation
on:
push:
branches:
- main
- fix/documentation
jobs:
# build-and-test:
# name: Build and test project before generating documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js LTS
# uses: actions/setup-node@v2
# with:
# node-version: lts/*
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Install dependencies
# run: npm ci --prefer-offline
# - name: Build project
# run: npm run build
# - name: Lint project code
# run: npm run lint
build-and-test:
name: Build and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# build-docs:
# name: Build and deploy documentation
# runs-on: ubuntu-latest
# needs: [build-and-test]
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js LTS
# uses: actions/setup-node@v2
# with:
# node-version: lts/*
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: Install dependencies
# run: npm ci --prefer-offline
# - name: Generate documentation
# run: npm run docs
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./docs
# publish_branch: docs
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint

build-docs:
name: Build and deploy documentation
runs-on: ubuntu-latest
needs: [build-and-test]
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Generate documentation
run: pnpm docs:generate

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs

deploy-docs:
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 1a69aae

Please sign in to comment.