Files
notes/.gitea/workflows/deploy.yaml
Jay 1209e30858
Some checks failed
Build and Push Static files / deploy (push) Failing after 59s
add workflow
2026-03-03 14:52:27 +00:00

44 lines
1.2 KiB
YAML

name: Build and Push Static files
on:
push:
branches:
- main # Trigger on pushes to your default branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build Docker Image
run: docker build -t mkdocs-builder -f ci/mkdocs/Dockerfile .
- name: Build Static Site
run: |
docker run --rm -v $(pwd):/docs mkdocs-builder build
- name: Deploy to Branch
run: |
# Configure Git
git config user.name "gitea-actions[bot]"
git config user.email "actions@noreply.gitea.io"
# Move site files to a temporary location
cp -r site /tmp/site_build
# Switch to/create the deployment branch
git checkout --orphan docs-static
git rm -rf .
# Move files back and commit
cp -r /tmp/site_build/. .
git add .
git commit -m "Automated MkDocs build: ${GITEA_SHA}"
# Push back to Gitea (Requires write permissions)
git push origin docs-static --force