react-native-vision-camera/.github/workflows/build-docs.yml

84 lines
2.2 KiB
YAML
Raw Normal View History

2021-03-03 04:53:13 -07:00
name: Build Documentation
on:
2021-03-03 05:17:34 -07:00
pull_request:
2021-03-04 02:28:51 -07:00
branches:
- main
paths:
- '.github/workflows/build-docs.yml'
- 'docs/**'
2021-03-09 01:45:06 -07:00
- 'src/**'
2021-03-04 02:28:51 -07:00
- '*.json'
2021-03-09 01:45:06 -07:00
- '*.js'
- '*.lock'
2021-03-03 04:53:13 -07:00
push:
2021-03-04 02:28:51 -07:00
branches:
- main
paths:
- '.github/workflows/build-docs.yml'
- 'docs/**'
2021-03-09 01:45:06 -07:00
- 'src/**'
2021-03-04 02:28:51 -07:00
- '*.json'
2021-03-09 01:45:06 -07:00
- '*.js'
- '*.lock'
2021-03-03 04:53:13 -07:00
jobs:
2021-03-03 05:17:34 -07:00
checks:
if: github.event_name != 'push'
name: Build Documentation
2021-03-03 05:17:34 -07:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2021-03-04 02:27:37 -07:00
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
2021-03-04 02:36:27 -07:00
- name: Test Docs Build
2021-03-03 05:17:34 -07:00
run: |
2021-03-04 02:38:42 -07:00
yarn install --frozen-lockfile
2021-03-04 02:36:27 -07:00
cd docs
2021-03-03 05:17:34 -07:00
yarn install --frozen-lockfile
2021-03-04 02:27:37 -07:00
yarn build
2021-03-03 04:53:13 -07:00
gh-release:
2021-03-03 05:17:34 -07:00
if: github.event_name != 'pull_request'
name: Build & Release Documentation
2021-03-03 04:53:13 -07:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2021-03-04 02:27:37 -07:00
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
2021-03-04 02:27:37 -07:00
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
2021-03-03 04:53:13 -07:00
- name: Release to GitHub Pages
env:
2021-03-09 06:14:30 -07:00
USE_SSH: false
GIT_USER: github-actions
2021-03-03 05:17:34 -07:00
CURRENT_BRANCH: main
DEPLOYMENT_BRANCH: gh-pages
2021-03-03 05:29:35 -07:00
github_token: ${{ secrets.GITHUB_TOKEN }}
2021-03-03 04:53:13 -07:00
run: |
date > generated.txt
git config user.name github-actions
git config user.email github-actions@github.com
2021-03-03 13:31:22 -07:00
yarn install --frozen-lockfile
2021-03-03 04:53:13 -07:00
cd docs
yarn install --frozen-lockfile
2021-03-03 05:03:29 -07:00
yarn deploy