Skip to content

chore(deps): update all non-major dependencies (#404) #370

chore(deps): update all non-major dependencies (#404)

chore(deps): update all non-major dependencies (#404) #370

name: Continuous Delivery
on:
push:
branches:
- master
jobs:
Docgen:
name: Docgen
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install Dependencies
run: yarn --immutable
- name: Build documentation
run: yarn docs
- name: Publish Docs
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
echo -e "\n# Initialize some useful variables"
REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
BRANCH_OR_TAG=`awk -F/ '{print $2}' <<< $GITHUB_REF`
CURRENT_BRANCH=`awk -F/ '{print $NF}' <<< $GITHUB_REF`
if [ "$BRANCH_OR_TAG" == "heads" ]; then
SOURCE_TYPE="branch"
else
SOURCE_TYPE="tag"
fi
echo -e "\n# Checkout the repo in the target branch"
TARGET_BRANCH="gh-pages"
git clone $REPO out -b $TARGET_BRANCH
echo -e "\n# Remove any old files in the out folder"
rm -rfv out/assets/*
rm -rfv out/interfaces/*
rm -rfv out/*.html
echo -e "\n# Move the generated docs to the newly-checked-out repo, to be committed and pushed"
rsync -vaI LICENSE.md out/
rsync -vaI README.md out/
rsync -vaI docs/ out/
echo -e "\n# Commit and push"
cd out
git add --all .
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_EMAIL}"
git commit -m "docs: api docs build for ${GITHUB_SHA}" || true
git push origin $TARGET_BRANCH
env:
GITHUB_ACTOR: Favware-bot
GITHUB_EMAIL: favwarebot@gmail.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}