Merge pull request #302 from infinum/form/addons #164
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
name: documentation | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
branches: | |
- main | |
- develop | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: ./website | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '19.x' | |
- name: Test Build | |
run: | | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
yarn run build | |
gh-release: | |
name: Release docs | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '19.x' | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} | |
- name: Release to GitHub Pages | |
env: | |
USE_SSH: true | |
GIT_USER: git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "gh-actions" | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
DEPLOYMENT_BRANCH=gh-pages yarn run deploy |