fix: 每次构建前同步主仓库文档,并修正 Yarn v3 的配置 #120
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: build-test | |
on: | |
push: | |
branches-ignore: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: build test | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Fetch docs | |
uses: actions/checkout@v3 | |
with: | |
repository: "MaaAssistantArknights/MaaAssistantArknights" | |
sparse-checkout: "docs" | |
path: "temp" | |
ref: "master" | |
fetch-depth: "1" | |
- name: Move and cleanup docs | |
run: | | |
mv ./temp/docs ./apps | |
rm -r ./temp | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build | |
run: yarn build |