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

62 lines
1.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'
- 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
npm run 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
- name: Release to GitHub Pages
env:
2021-03-03 05:22:40 -07:00
USE_SSH: false
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"
cd docs
yarn install --frozen-lockfile
2021-03-03 05:03:29 -07:00
yarn deploy