Change deploy workflow schedule to hourly at 10 minutes #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to GitHub Pages | |
| on: | |
| repository_dispatch: | |
| types: [md_changes] | |
| schedule: [{cron: "10 * * * *"}] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| env: | |
| MAANTE_UPSTREAM_DOCS_BRANCH: ${{ vars.MAANTE_UPSTREAM_DOCS_BRANCH || 'dev' }} | |
| jobs: | |
| build: | |
| if: > | |
| github.event_name != 'repository_dispatch' || | |
| github.event.client_payload.source_branch == '' || | |
| github.event.client_payload.source_branch == (vars.MAANTE_UPSTREAM_DOCS_BRANCH || 'dev') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref_name }} | |
| - name: Checkout MaaNTE repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 1bananachicken/MaaNTE | |
| ref: ${{ env.MAANTE_UPSTREAM_DOCS_BRANCH }} | |
| path: MaaNTE-temp | |
| - name: Sync docs from MaaNTE | |
| run: | | |
| rsync -av --delete \ | |
| --exclude='/README.md' \ | |
| --exclude='/introduction/README.md' \ | |
| --exclude='/develop/README.md' \ | |
| --exclude='/qq-group/' \ | |
| MaaNTE-temp/docs/zh_cn/ docs/zh_cn/ | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Update QQ group link | |
| run: pnpm run qq-group:update | |
| - name: Commit QQ group data | |
| run: | | |
| if git diff --quiet -- docs/.vuepress/public/data/qq-group.json; then | |
| echo "QQ group data is already up to date." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add docs/.vuepress/public/data/qq-group.json | |
| git commit -m "Update QQ group data [skip ci]" | |
| git push origin HEAD:main | |
| - name: Build with VuePress | |
| run: pnpm run docs:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vuepress/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |