From a43654a6ad03d24299368f24b492b1361d2cbd46 Mon Sep 17 00:00:00 2001 From: mcpexiaoxing-lgtm <你的邮箱@example.com> Date: Fri, 12 Jun 2026 16:36:48 +0800 Subject: [PATCH] ci: add GitHub Actions workflows --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++++++++++ .github/workflows/pages.yml | 30 ++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7479476 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: [main, dev] + pull_request: + branches: [main, dev] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Markdown Lint + uses: DavidAnson/markdownlint-cli2-action@v19 + with: + globs: '**/*.md' + continue-on-error: true + + - name: Check Links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + continue-on-error: true + + validate-yaml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate YAML files + run: | + pip install pyyaml + python -c " + import yaml, glob, sys + errors = 0 + for f in glob.glob('**/*.y*ml', recursive=True): + try: + with open(f) as fh: yaml.safe_load(fh) + print(f'OK: {f}') + except Exception as e: + print(f'FAIL: {f} - {e}') + errors += 1 + sys.exit(1 if errors else 0) + " diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..85a371d --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,30 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [gh-pages] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v3 + with: + path: '.' + - id: deployment + uses: actions/deploy-pages@v4