35 lines
1020 B
YAML
35 lines
1020 B
YAML
name: Build and Deploy MkDocs
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and Extract Site
|
|
run: |
|
|
# Build the image (the 'RUN mkdocs build' happens here)
|
|
docker build -t mkdocs-temp -f ci/mkdocs/Dockerfile .
|
|
|
|
# Create a temporary container and copy the 'site' folder out of it
|
|
docker create --name temp-container mkdocs-temp
|
|
docker cp temp-container:/build/site ./site
|
|
docker rm temp-container
|
|
|
|
- name: Deploy to Branch
|
|
run: |
|
|
git config user.name "gitea-actions[bot]"
|
|
git config user.email "actions@noreply.gitea.io"
|
|
|
|
# Standard deployment logic
|
|
cp -r site /tmp/site_build
|
|
git checkout --orphan docs-static
|
|
git rm -rf .
|
|
cp -r /tmp/site_build/. .
|
|
git add .
|
|
git commit -m "Automated MkDocs build"
|
|
git push origin docs-static --force
|