Merge pull request #8 from KoshakMineDEV/master #79
This file contains 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: 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-APP-and-deploy: | |
name: 构建并部署APP | |
runs-on: ubuntu-latest | |
needs: check-files | |
if: contains(needs.check-files.outputs.changed-files, 'APP/') || (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-node@v3 | |
name: 安装Node环境 | |
with: | |
node-version: 16 | |
- name: 安装依赖库 | |
run: cd APP && npm install | |
- name: 构建APP | |
run: cd APP && npm run build | |
- name: 上传PNX主页压缩包 | |
uses: actions/upload-artifact@v3 | |
if: success() | |
with: | |
name: doc_zh-cn | |
path: APP/dist | |
- name: 部署到PNX云 | |
run: bash .github/scripts/deploy-app.sh ${{ secrets.PNX_CLOUD_TOKEN }} | |
deploy-static: | |
name: 部署静态文件 | |
runs-on: ubuntu-latest | |
needs: check-files | |
if: contains(needs.check-files.outputs.changed-files, 'Index/') || (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 | |
- name: 上传PNX主页压缩包 | |
uses: actions/upload-artifact@v3 | |
if: success() | |
with: | |
name: doc_zh-cn | |
path: Index/src/main/web | |
- name: 部署PNX主页到阿里云 | |
uses: fangbinwei/aliyun-oss-website-action@v1 | |
with: | |
accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
bucket: pnx-index | |
endpoint: oss-cn-hongkong.aliyuncs.com | |
folder: Index/src/main/web | |
skipSetting: true | |
- name: 部署到PNX云 | |
run: bash .github/scripts/deploy-static.sh ${{ secrets.PNX_CLOUD_TOKEN }} | |
- name: 输出上传内容 | |
run: echo ${{ steps.upload-oss.outputs.url }} |