Skip to content

feat: updated test for undefined #335

feat: updated test for undefined

feat: updated test for undefined #335

name: Deploy Documentation CD
on:
workflow_dispatch:
push:
branches:
- master
env:
rid: ${{ github.run_id }}-${{ github.run_number }}
jobs:
initialize:
name: Initialize
runs-on: ubuntu-20.04
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Setup Environment
uses: actions/setup-node@v2
with:
node-version: 16.x
check-latest: true
- name: Install Dependencies
run: yarn
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: node_modules/
key: node-modules-${{ runner.os }}-${{ env.rid }}
build-source:
name: Build - Source
needs: initialize
runs-on: ubuntu-20.04
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Setup Environment
uses: actions/setup-node@v2
with:
node-version: 16.x
check-latest: true
- name: Uncache Dependencies
uses: actions/cache@v2
with:
path: node_modules/
key: node-modules-${{ runner.os }}-${{ env.rid }}
- name: Build Source
run: yarn ci:build
- name: Cache Documentation
uses: actions/cache@v2
with:
path: docs/
key: docs-${{ runner.os }}-${{ env.rid }}
deploy-documentation:
name: Deploy - Documentation
needs: build-source
runs-on: ubuntu-20.04
steps:
- name: Checkout Project
uses: actions/checkout@v2
with:
ref: documentation
- name: Clean Documentation
run: |
rm -rf ./docs
- name: Uncache Documentation
uses: actions/cache@v2
with:
path: docs/
key: docs-${{ runner.os }}-${{ env.rid }}
- name: Deploy Documentation
run: |
git config --global user.name "Automation"
git config --global user.email "[email protected]"
git add ./docs
FILE_COUNT=$(git status -s | wc -l | xargs)
if [[ $FILE_COUNT != '0' ]]
then
echo "Found $FILE_COUNT changed documentation files."
git commit -m "ci(docs): deploy documentation [skip ci] [skip release]"
git push origin documentation
else
echo "Documentation files have not changed."
echo "Documentation will not be published."
fi