Skip to content

move 2.0

move 2.0 #228

Workflow file for this run

name: PNX-doc
on: [ push, workflow_dispatch ]
jobs:
check-files:
name: 检查仓库文件
runs-on: ubuntu-latest
outputs:
changed-files: ${{ steps.check-changed-files.outputs.all_changed_and_modified_files }}
steps:
- name: 检出仓库内容
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 检查文件改动情况
id: check-changed-files
uses: tj-actions/[email protected]
with:
since_last_remote_commit: 'true'
- name: 输出更改文件列表
run: echo ${{ steps.check-changed-files.outputs.all_changed_and_modified_files }}
build:
name: 渲染markdown文件
runs-on: ubuntu-latest
needs: check-files
if: contains(needs.check-files.outputs.changed-files, 'web/') || contains(needs.check-files.outputs.changed-files, 'PowerNukkitX/') || (github.event_name == 'push' && contains(github.event.commits[0].message, '+b')) || (github.event_name == 'workflow_dispatch')
steps:
- uses: actions/checkout@v1
name: 检出仓库内容
with:
fetch-depth: 0
- uses: actions/setup-java@v2
name: 配置java环境
with:
distribution: 'temurin'
java-version: '17'
- name: 下载PowerDoc
uses: robinraju/[email protected]
with:
repository: "PowerNukkitX/PowerDoc"
latest: true
fileName: "*"
- name: 构建中文文档
run: java -jar PowerDoc-1.0-SNAPSHOT-shaded.jar ./web/book.json
- name: 上传中文文档压缩包
uses: actions/upload-artifact@v3
if: success()
with:
name: doc_zh-cn
path: web/html/zh-cn
- name: 部署中文文档
uses: fangbinwei/aliyun-oss-website-action@v1
if: (github.ref_name == 'master') && success()
with:
accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
bucket: pnx-doc
endpoint: oss-cn-hongkong.aliyuncs.com
otherCacheControl: no-cache
folder: web/html
skipSetting: true
- name: 输出上传内容
run: echo ${{ steps.upload-oss.outputs.url }}