feat(github): ci test #167
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: | |
if: contains(github.event.head_commit.message, 'docs') | |
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: 安装依赖 | |
run: npm install | |
- name: 构建项目 | |
run: npm run docs:build | |
- 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 | |
run: ossutil cp -rf ./projects/document/docs/.vitepress/dist oss://website-cocos-fe/ | |
github-ids: | |
if: contains(github.event.head_commit.message, 'github') | |
runs-on: ubuntu-latest | |
steps: | |
- 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: 项目部署 - githubIds | |
run: ossutil cp -rf ./projects/github-ids/github-ids.json oss://90s/github-ids/ |