Merge pull request #46 from Maa-NTE/homepage #135
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: | |
| schedule: | |
| - cron: "45 * * * *" | |
| repository_dispatch: | |
| types: [md_changes] | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| 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 data | |
| run: pnpm run qq-group:update | |
| env: | |
| QQ_GROUP_INFO_CKEY: ${{ secrets.QQ_GROUP_INFO_CKEY }} | |
| - 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 |