-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
609768e
commit 44dfaf2
Showing
1 changed file
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Build docs on version update | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
tags: | ||
- "*" | ||
|
@@ -15,7 +13,6 @@ on: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build-and-deploy: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
|
@@ -24,11 +21,30 @@ jobs: | |
uses: actions/checkout@v2 | ||
|
||
- name: Install and Build | ||
# use force because typedoc doesn't support current version of TS, but it still build | ||
run: | | ||
npm install | ||
npm run docs | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT | ||
- name: Commit changes | ||
if: steps.git-check.outputs.changes == 'true' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add -A | ||
git commit -m "Auto-update documentation" | ||
- name: Push changes | ||
if: steps.git-check.outputs.changes == 'true' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main | ||
|
||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
|