Skip to content

Commit

Permalink
Merge pull request #139 from caorushizi/fix/docs
Browse files Browse the repository at this point in the history
ci: 🎡  modify github actions
  • Loading branch information
caorushizi authored May 2, 2024
2 parents 4265525 + d388864 commit 97b29e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,13 @@ jobs:
# step1: check out repository
- name: Check out git repository
uses: actions/checkout@v4
with:
submodules: true

# step2: install node env
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

# step3: install go env
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.5"
cache-dependency-path: "internal/go.sum"

# step4: install python env
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

# step5: install pnpm env
- uses: pnpm/action-setup@v3
with:
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ concurrency:
cancel-in-progress: false

env:
BUILD_PATH: "."
BUCKET: downloader-docs
ENDPOINT: oss-cn-beijing.aliyuncs.com
ACCESS_KEY: LTAI5tLckcUrBtj7bCiUYwWz
Expand All @@ -28,22 +27,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
with:
node-version: "16"
- name: Install PNPM
run: npm i -g pnpm
- name: Install dependencies
run: pnpm install
working-directory: ${{ env.BUILD_PATH }}
version: latest
run_install: true

- name: Build with Vitepress
run: pnpm run docs:build
working-directory: ${{ env.BUILD_PATH }}

- name: Install Alibaba Cloud OSSUTIL
run: wget http://gosspublic.alicdn.com/ossutil/1.6.10/ossutil64 && chmod +x ossutil64

- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil64 config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig

- name: Upload the web folder to the chosen OSS bucket
run: ./ossutil64 --config-file .ossutilconfig cp ${{ github.workspace }}/docs/.vitepress/dist oss://${BUCKET} -r -f

0 comments on commit 97b29e7

Please sign in to comment.