-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (60 loc) · 2.14 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
74 lines (60 loc) · 2.14 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy Documentation
on:
push:
branches:
- develop
- test
- main
jobs:
deploy_docs:
name: Build and Deploy Docs [${{ github.ref_name }}]
runs-on: ubuntu-latest
container:
image: mckeea/quarto-doc-builder:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Mark repo as safe for Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Show commit history
run: git log --oneline -n 5
- name: Get changed .qmd files on current branch
run: |
(git diff --name-only HEAD^ HEAD | grep -E '\.qmd$' || true) > modified_docs_list.txt
echo "Modified .qmd files:"
cat modified_docs_list.txt
- name: Generate intros and keywords
uses: addnab/docker-run-action@v3
with:
image: mckeea/llm-doc-annotator:latest
options: -e GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }} -v ${{ github.workspace }}:/app
run: python .github/scripts/generate_intros_and_keywords.py modified_docs_list.txt
- name: Commit updated LLM cache
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .llm_cache
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Update LLM cache [skip ci]"
git push origin HEAD
fi
- name: Generate intros and keywords
uses: addnab/docker-run-action@v3
with:
image: mckeea/llm-doc-annotator:latest
options: -e GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }} -v ${{ github.workspace }}:/app
run: python .github/scripts/generate_intros_and_keywords.py
- name: Build Docs
run: .github/scripts/build-docs.sh
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: _site
target-folder: ${{ github.ref_name }}
clean: true
token: ${{ secrets.GITHUB_TOKEN }}