Skip to content

Merge pull request #25 from fnbrjs/main #144

Merge pull request #25 from fnbrjs/main

Merge pull request #25 from fnbrjs/main #144

Workflow file for this run

name: "CI"
on:
push:
branches:
- '*'
- '!docs'
tags:
- '*'
jobs:
docgen:
if: github.repository_owner == 'fnbrjs'
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Setup git
run: |
git config --global user.name "FNBR Bot"
git config --global user.email fnbr@tusinean.ro
- name: Set Up NodeJS
uses: actions/setup-node@v2
with:
node-version: 20
- name: Checkout Main Repository
uses: actions/checkout@v2
with:
path: main
- name: Checkout Main Repository Docs Branch
uses: actions/checkout@v2
with:
path: docs
ref: docs
- name: Checkout DocGen Repository
uses: actions/checkout@v2
with:
repository: fnbrjs/docgen
token: ${{ secrets.BOT_PAT }}
path: docgen
- name: Install Main Repository Dependencies
working-directory: ./main
run: npm ci
- name: Install DocGen Dependencies
working-directory: ./docgen
run: npm ci
- name: Compile DocGen
working-directory: ./docgen
run: npm run build
- name: Generate Documentation
working-directory: ./docgen
run: node . ../main
- uses: actions-ecosystem/action-regex-match@v2
id: current_branch
with:
text: ${{ github.ref }}
regex: '(?<=\/)(\w|\d|\.)+$'
- name: Deploy Documentation
working-directory: ./docs
shell: bash
env:
CURRENT_BRANCH: ${{ steps.current_branch.outputs.match }}
run: |
git pull https://fnbr-bot:${{ secrets.BOT_PAT }}@github.com/fnbrjs/fnbr.js docs
mv ../docgen/docs.json ./${CURRENT_BRANCH}.json
git add . -A
git commit -m "Docs build for ${CURRENT_BRANCH}: ${GITHUB_SHA}"
git push https://fnbr-bot:${{ secrets.BOT_PAT }}@github.com/fnbrjs/fnbr.js docs