Skip to content

学籍学历变更指引 | 修改“关于升学”;增加“关于学信网账号” #4

学籍学历变更指引 | 修改“关于升学”;增加“关于学信网账号”

学籍学历变更指引 | 修改“关于升学”;增加“关于学信网账号” #4

name: Preview PR Build
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'content/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 检出主仓库代码
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
submodules: true
- name: 检出 PR 修改的部分
run: |
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
git checkout -qf FETCH_HEAD
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
extended: true
- name: Build site
run: hugo --minify --enableGitInfo
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
projectName: mtfwiki-preview
directory: public
- name: 评论 PR 部署链接
uses: actions/github-script@v6
with:
script: |
const prNumber = context.payload.pull_request.number;
const previewUrl = `${{ steps.deploy.outputs.url }}`;
const comment = `🚀 预览部署完成! 访问链接: ${previewUrl}/zh-cn/`;
github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
});