Skip to content

Merge pull request #7 from Verox001/master #66

Merge pull request #7 from Verox001/master

Merge pull request #7 from Verox001/master #66

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, 'doc/') || contains(needs.check-files.outputs.changed-files, 'build/') || (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: 构建中文文档
run: cd build && bash build.sh
- name: 上传文档
uses: actions/upload-artifact@v3
if: success()
with:
name: PNX_Documents
path: target/output
- name: 部署文档到OSS
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
folder: target/output
skipSetting: true
- name: 部署到PNX云
run: bash .github/scripts/deploy-doc.sh ${{ secrets.PNX_CLOUD_TOKEN }}
- name: 输出上传内容
run: echo ${{ steps.upload-oss.outputs.url }}