Skip to content

Commit d641e30

Browse files
committed
docs: add composite action for pushing docs
1 parent 7b3eaf7 commit d641e30

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: composite-docs
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
required: true
8+
type: string
9+
target-directory:
10+
required: true
11+
type: string
12+
13+
branches: main
14+
paths:
15+
- 'docs/**'
16+
17+
jobs:
18+
Docs:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
ref: ${{ inputs.ref }}
24+
- name: Setup mdBook
25+
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea
26+
with:
27+
mdbook-version: 'latest'
28+
- name: Generate book
29+
run: |
30+
cd docs
31+
mdbook build
32+
- name: Push to docs repo
33+
uses: hishamhm/github-action-push-to-another-repository@b3514b264edf63bd8ea41fb5cd4f5b93979bdf81
34+
env:
35+
API_TOKEN_GITHUB: ${{ secrets.DOCS_PUSH_GITHUB_TOKEN }}
36+
with:
37+
destination-github-username: 'teal-language'
38+
destination-repository-name: 'teal-language.github.io'
39+
user-email: hisham@gobolinux.org
40+
target-branch: main
41+
source-directory: 'docs/book'
42+
target-directory: ${{ inputs.target-directory }}

0 commit comments

Comments
 (0)