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

89 lines
2.6 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:
branches: [main]
2021-03-03 04:53:13 -07:00
push:
branches: [main]
jobs:
2021-03-03 05:17:34 -07:00
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
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-
- name: Install modules
run: yarn install --frozen-lockfile
- name: Install modules (example/)
run: yarn example --frozen-lockfile
2021-03-03 05:17:34 -07:00
- name: Test Build
run: |
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'
2021-03-03 04:53:13 -07:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT
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-
- name: Install modules
run: yarn install --frozen-lockfile
- name: Install modules (example/)
run: yarn example --frozen-lockfile
2021-03-03 04:53:13 -07:00
- name: Release to GitHub Pages
env:
2021-03-03 06:45:57 -07:00
USE_SSH: true
2021-03-03 04:53:13 -07:00
GIT_USER: git
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: |
2021-03-03 05:22:40 -07:00
git config --global user.email "actions@github.com"
2021-03-03 04:53:13 -07:00
git config --global user.name "gh-actions"
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