Skip to content

Commit ceada35

Browse files
ci: add docs deploy workflows (#29)
1 parent f2a2a4b commit ceada35

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/docs-check.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docs build check
2+
env:
3+
YARN_ENABLE_HARDENED_MODE: 0
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '.github/workflows/docs-check.yml'
10+
- docs/**
11+
pull_request:
12+
paths:
13+
- '.github/workflows/docs-check.yml'
14+
- docs/**
15+
jobs:
16+
build:
17+
if: github.repository == 'AppAndFlow/react-native-ease'
18+
runs-on: ubuntu-latest
19+
env:
20+
WORKING_DIRECTORY: docs
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Use Node.js 20.x
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20.x
27+
- name: Install docs deps
28+
working-directory: ${{ env.WORKING_DIRECTORY }}
29+
run: yarn install
30+
- name: Build docs
31+
working-directory: ${{ env.WORKING_DIRECTORY }}
32+
run: yarn build

.github/workflows/docs-deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docs publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- docs/**
8+
9+
jobs:
10+
publish:
11+
if: github.repository == 'AppAndFlow/react-native-ease'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out
15+
uses: actions/checkout@v4
16+
17+
- name: Build docs
18+
run: >-
19+
git config --local user.email "action@github.com"
20+
&& git config --local user.name "GitHub Action"
21+
&& cd docs
22+
&& yarn
23+
&& yarn build
24+
25+
- name: Publish generated content to GitHub Pages
26+
uses: JamesIves/github-pages-deploy-action@releases/v3
27+
with:
28+
FOLDER: docs/build
29+
BRANCH: gh-pages
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)