增加微信验证文件 #42
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 Hugo to GitHub Pages | |
| on: | |
| push: | |
| branches: [ "master" ] # 触发分支 | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # 包含主题子模块 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: "0.145.0" | |
| extended: true # 启用 Extended 版本 | |
| - name: Build | |
| run: hugo --minify --cleanDestinationDir | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| cname: plutotree.me | |
| force_orphan: true | |
| - name: Deploy files using Rsync | |
| uses: Burnett01/rsync-deployments@5.2 | |
| with: | |
| switches: -avzr --delete | |
| path: ./public/ | |
| remote_path: /plutotree.cn | |
| remote_host: plutotree.cn | |
| remote_user: update_web | |
| remote_key: ${{ secrets.PLUTOTREE_CN_SSH_KEY }} | |
| - name: Upload Artifactia | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: algolia-index | |
| path: public/index.json | |
| # 使用 Algolia CLI 上传 | |
| - name: Install Algolia CLI | |
| run: npm install -g @algolia/cli | |
| - name: Push Index to Algolia | |
| run: algolia import -n index -s public/index.json -a ${{ secrets.ALGOLIA_APP_ID }} -k ${{ secrets.ALGOLIA_WRITE_KEY }} -b 10 | |
| - name: Pushover Notification | |
| uses: umahmood/pushover-actions@v1.1.0 | |
| env: | |
| PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} | |
| PUSHOVER_USER: ${{ secrets.PUSHOVER_USER }} | |
| with: | |
| status: ${{ job.status }} | |
| title: "pages Deploy Notification" | |
| message: ${{github.event.head_commit.message}} |