44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Build and Deploy MkDocs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # change if needed
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and Extract Site
|
|
run: |
|
|
docker build -t mkdocs-temp -f ci/mkdocs/Dockerfile .
|
|
docker create --name temp-container mkdocs-temp
|
|
docker cp temp-container:/build/site ./site
|
|
docker rm temp-container
|
|
|
|
- name: Deploy to docs-static Branch
|
|
run: |
|
|
git config user.name "gitea-actions[bot]"
|
|
git config user.email "actions@noreply.gitea.io"
|
|
|
|
# Create fresh orphan branch
|
|
git checkout --orphan docs-static
|
|
|
|
# Remove ALL tracked files from index + working tree
|
|
git rm -rf . 2>/dev/null || true
|
|
|
|
# Clean untracked files too (important!)
|
|
rm -rf *
|
|
|
|
# Copy only site contents (not the folder itself)
|
|
cp -r site/. .
|
|
|
|
git add .
|
|
git commit -m "Automated MkDocs build"
|
|
|
|
git push origin docs-static --force
|