Skip to content

Commit 398a602

Browse files
author
Hal Eisen
committed
Change to use the 'tag' trigger instead of manual
1 parent fbf2fa8 commit 398a602

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

.github/workflows/publish-doc-db.yaml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Release Documentation Database
33
permissions: write-all
44

55
on:
6-
workflow_dispatch: # Trigger manually
6+
push:
7+
tags:
8+
- 'db-*' # Trigger on tags like 'db-2024-03-21'
79

810
jobs:
911
build-and-release:
@@ -38,29 +40,16 @@ jobs:
3840
- name: Install dependencies
3941
run: uv pip install -r requirements.txt
4042

41-
- name: Set date variable
42-
run: echo "DATE=$(date +%F)" >> $GITHUB_ENV
43-
44-
- name: Configure Git
45-
run: |
46-
git config --global user.name "GitHub Actions: Release Documentation Database"
47-
git config --global user.email "actions@github.com"
48-
49-
- name: Create and push tag
50-
run: |
51-
git tag -a "v${{ env.DATE }}" -m "Documentation database release for ${{ env.DATE }}"
52-
git push origin "v${{ env.DATE }}"
53-
5443
- name: Create build directory
5544
run: mkdir -p build
5645

5746
- name: Store Kotlin documentation
5847
run: |
59-
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ env.DATE }}.sqlite -d SourceDocs/KotlinDocs/html
60-
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ env.DATE }}.sqlite -d SourceDocs/KotlinDocs/html/images
61-
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ env.DATE }}.sqlite -d SourceDocs/KotlinDocs/html/frontend
62-
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ env.DATE }}.sqlite -f SourceDocs/KotlinDocs/kotlin-spec.pdf
63-
if [ ! -f "build/documentation-db-${{ env.DATE }}.sqlite" ]; then
48+
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ github.ref_name }}.sqlite -d SourceDocs/KotlinDocs/html
49+
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ github.ref_name }}.sqlite -d SourceDocs/KotlinDocs/html/images
50+
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ github.ref_name }}.sqlite -d SourceDocs/KotlinDocs/html/frontend
51+
PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ github.ref_name }}.sqlite -f SourceDocs/KotlinDocs/kotlin-spec.pdf
52+
if [ ! -f "build/documentation-db-${{ github.ref_name }}.sqlite" ]; then
6453
echo "Failed to create database file"
6554
exit 1
6655
fi
@@ -69,12 +58,12 @@ jobs:
6958
# - name: Store Java documentation
7059
# run: |
7160
# for dir in $(find SourceDocs/JavaDocs/html -type d); do
72-
# PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ env.DATE }}.sqlite -d "$dir"
61+
# PYTHONPATH=scripts uv run python scripts/ingest.py -p build/documentation-db-${{ github.ref_name }}.sqlite -d "$dir"
7362
# done
7463

7564
- name: Verify database
7665
run: |
77-
if [ ! -f "build/documentation-db-${{ env.DATE }}.sqlite" ]; then
66+
if [ ! -f "build/documentation-db-${{ github.ref_name }}.sqlite" ]; then
7867
echo "Database file not found"
7968
exit 1
8069
fi
@@ -83,6 +72,6 @@ jobs:
8372
- name: Upload release asset
8473
uses: softprops/action-gh-release@v1
8574
with:
86-
files: build/documentation-db-${{ env.DATE }}.sqlite
75+
files: build/documentation-db-${{ github.ref_name }}.sqlite
8776
env:
8877
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)