-
-
Notifications
You must be signed in to change notification settings - Fork 51
45 lines (39 loc) · 1.17 KB
/
gen-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Generate Documentation
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: macOS-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
brew install mint
mint install apple/swift-docc@main
echo "$HOME/.mint/bin" >> $GITHUB_PATH
- name: Build
env:
DOCC: docc
run: |
./scripts/build-docc.sh
- name: Commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REMOTE_BRANCH: "gh-pages"
run: |
REMOTE_REPO="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git checkout ${REMOTE_BRANCH}
rm -rf 7.x.x/
mv docs/soto-core/7.x.x/ 7.x.x/
git add --all 7.x.x
git status
git commit -m "Documentation for https://github.com/${GITHUB_REPOSITORY}/tree/${GITHUB_SHA}" -m "Generated by gen-docs.yml"
git push ${REMOTE_REPO} ${REMOTE_BRANCH}