Skip to content

Bump oceanic.js from 1.9.0 to 1.10.4 #260

Bump oceanic.js from 1.9.0 to 1.10.4

Bump oceanic.js from 1.9.0 to 1.10.4 #260

name: Generate API Documentation
on:
push:
branches:
- master
- LL-v4
pull_request:
jobs:
TypeDoc:
name: Generate API Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Install NodeJS v16
uses: actions/setup-node@v1
with:
node-version: 18
- name: Restore CI Cache
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn
- name: Test Docs
if: github.event_name == 'pull_request'
run: yarn docs
- name: Publish Docs
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/LL-v4')
run: |
#!/bin/bash
set -euxo pipefail
echo -e "\n# Initialise 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
yarn docs
echo -e "\n# Move the generated docs to the newly-checked-out repo, to be committed and pushed"
rsync -vau docs/ out/
rsync -vau README.md LICENSE out/
echo -e "\n# Commit and push"
cd out
git add --all .
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git commit -m "Docs build: ${GITHUB_SHA}" || true
git push origin $TARGET_BRANCH
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}