feat: add QA #153
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: 20 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: 安装依赖 | |
if: contains(github.event.head_commit.message, 'docs') | |
run: npm install | |
- name: 构建项目 | |
if: contains(github.event.head_commit.message, 'docs') | |
run: | | |
npm run docs:build | |
echo 构建成功. | |
- name: 启用 oss-util 工具 | |
uses: manyuanrong/[email protected] | |
with: | |
endpoint: 'oss-cn-hangzhou.aliyuncs.com' | |
access-key-id: ${{ secrets.OSS_ID }} | |
access-key-secret: ${{ secrets.OSS_SECRET }} | |
- name: 项目部署 - docs | |
if: contains(github.event.head_commit.message, 'docs') | |
run: | | |
ossutil cp -rf ./projects/document/docs/.vitepress/dist oss://website-cocos-fe/ | |
- name: 项目部署 - githubIds | |
if: contains(github.event.head_commit.message, 'github') | |
run: | | |
ossutil cp -rf ./projects/github-ids/github-ids.json oss://90s/github-ids/ |