aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFangcatChina <f20091219@outlook.com>2026-07-31 06:33:20 +0000
committerIridiumNan <2930416610@qq.com>2026-08-01 13:31:50 +0000
commit93f676c92132b50fd7ecc32aac05442fd2916018 (patch)
tree2f5ffc2f78e34f8e0dfd38cc853016ebd7313ec7 /.github
parentFix the vim key map explanation and add ssh connection guidance for (diff)
Merge #16, migrate Actions to GIthub
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/mkdocs-deploy.yml60
-rw-r--r--.github/workflows/sync_to_gitea.yml.disabled (renamed from .github/workflows/sync_to_gitea.yml)0
2 files changed, 60 insertions, 0 deletions
diff --git a/.github/workflows/mkdocs-deploy.yml b/.github/workflows/mkdocs-deploy.yml
new file mode 100644
index 0000000..1df857d
--- /dev/null
+++ b/.github/workflows/mkdocs-deploy.yml
@@ -0,0 +1,60 @@
+name: Deploy MkDocs to Another Repository
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - 'docs/**'
+ - 'mkdocs.yml'
+ - 'overrides/**'
+ - '.github/workflows/mkdocs-deploy.yml'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+jobs:
+ build-and-deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.13'
+ cache: 'pip'
+
+ - name: Install MkDocs dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+
+ - name: Build MkDocs site
+ run: mkdocs build --strict
+ env:
+ DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
+
+ - name: Deploy to target repository
+ env:
+ TARGET_REPO: https://github.com/LinuxCabin/handbook-site
+ TARGET_BRANCH: gh-pages
+ DEPLOY_TOKEN: ${{ secrets.DEPLOY_KEY }}
+ CUSTOM_DOMAIN: hb.091209.xyz
+ run: |
+ cd site
+ echo "${{ env.CUSTOM_DOMAIN }}" > CNAME
+ git init
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git add .
+ git commit -m "Deploy site $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
+ git push --force https://x-access-token:${DEPLOY_TOKEN}@${TARGET_REPO#https://} HEAD:${TARGET_BRANCH} \ No newline at end of file
diff --git a/.github/workflows/sync_to_gitea.yml b/.github/workflows/sync_to_gitea.yml.disabled
index b42a7d2..b42a7d2 100644
--- a/.github/workflows/sync_to_gitea.yml
+++ b/.github/workflows/sync_to_gitea.yml.disabled