diff options
| author | FangcatChina <f20091219@outlook.com> | 2026-08-14 11:43:01 +0000 |
|---|---|---|
| committer | FangcatChina <f20091219@outlook.com> | 2026-08-14 14:39:38 +0000 |
| commit | 7a75cdf0d395f179a27f69e9829e3c9e39302223 (patch) | |
| tree | cb349d0d9dbbfdfa04f2f0c4800b01f381027d77 | |
| parent | fix: tuna mirror (diff) | |
feat: new workflow
| -rw-r--r-- | .forgejo/workflows/mkdocs-deploy.yml (renamed from .github/workflows/mkdocs-deploy.yml) | 17 | ||||
| -rw-r--r-- | .gitea/workflows/mkdocs-deploy.yml.disabled | 60 | ||||
| -rw-r--r-- | .github/workflows/sync_to_forgejo.yml | 20 | ||||
| -rw-r--r-- | .github/workflows/sync_to_gitea.yml.disabled | 15 |
4 files changed, 7 insertions, 105 deletions
diff --git a/.github/workflows/mkdocs-deploy.yml b/.forgejo/workflows/mkdocs-deploy.yml index 9a96a0d..efb6592 100644 --- a/.github/workflows/mkdocs-deploy.yml +++ b/.forgejo/workflows/mkdocs-deploy.yml @@ -8,7 +8,7 @@ on: - 'docs/**' - 'mkdocs.yml' - 'overrides/**' - - '.github/workflows/mkdocs-deploy.yml' + - '.forgejo/workflows/mkdocs-deploy.yml' workflow_dispatch: permissions: @@ -40,21 +40,18 @@ jobs: - 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.linuxcabin.top + TARGET_REPO: https://codeberg.org/LinuxCabin/handbook-site + TARGET_BRANCH: pages + DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} run: | cd site - echo "${{ env.CUSTOM_DOMAIN }}" > CNAME + echo "hb.linuxcabin.top" > CNAME git init - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.name "forgejo-actions[bot]" + git config user.email "forgejo-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/.gitea/workflows/mkdocs-deploy.yml.disabled b/.gitea/workflows/mkdocs-deploy.yml.disabled deleted file mode 100644 index efdbf7b..0000000 --- a/.gitea/workflows/mkdocs-deploy.yml.disabled +++ /dev/null @@ -1,60 +0,0 @@ -name: Deploy MkDocs to Another Repository - -on: - push: - branches: - - main - paths: - - 'docs/**' - - 'mkdocs.yml' - - 'overrides/**' - - '.gitea/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: '' # No Cache - - - 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 # 创建 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_forgejo.yml b/.github/workflows/sync_to_forgejo.yml deleted file mode 100644 index f8d7637..0000000 --- a/.github/workflows/sync_to_forgejo.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Force Push to Any Remote Repo - -on: - push: - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Force push to target repository - env: - TARGET_REPO_URL: ${{ secrets.TARGET_REPO_URL }} - run: | - git remote add target ${TARGET_REPO_URL} - git push --force target
\ No newline at end of file diff --git a/.github/workflows/sync_to_gitea.yml.disabled b/.github/workflows/sync_to_gitea.yml.disabled deleted file mode 100644 index b42a7d2..0000000 --- a/.github/workflows/sync_to_gitea.yml.disabled +++ /dev/null @@ -1,15 +0,0 @@ -name: Sync to Gitea -on: - push: - branches: [ main ] - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Trigger Gitea mirror sync - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - curl -X POST \ - "https://git.13-trixie.top/api/v1/repos/LinuxCabin/linux-handbook/mirror-sync?token=${{ secrets.GITEA_TOKEN }}"
\ No newline at end of file |
