-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 修复github actions问题 * feat: 增加pr workflow
- Loading branch information
Showing
2 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,53 +6,62 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.5.0 | ||
run_install: false | ||
|
||
- name: Use Node.js 22 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Code lint | ||
run: pnpm lint | ||
|
||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.5.0 | ||
run_install: false | ||
- name: Use Node.js 22 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build (Generate static files) | ||
run: pnpm generate | ||
|
||
- name: Setup aliyun OSS | ||
uses: yizhoumo/setup-ossutil@v3 | ||
uses: yizhoumo/setup-ossutil@v2 | ||
with: | ||
endpoint: oss-cn-hangzhou.aliyuncs.com | ||
access-key-id: ${{ secrets.ALI_KEY_ID }} | ||
access-key-secret: ${{ secrets.ALI_KEY_SECRET }} | ||
|
||
- name: Upload files to OSS | ||
run: | | ||
ossutil rm -f oss://zq-auth-v2/ -r --exclude "*.txt" | ||
ossutil cp -rf dist oss://zq-auth-v2/ | ||
ossutil set-meta oss://zq-auth-v2/ Cache-Control:no-cache --include "*.html" -r | ||
- name: Refresh CDN | ||
uses: visionwx/[email protected] | ||
with: | ||
accessKeyId: ${{ secrets.ALI_KEY_ID }} | ||
accessKeySecret: ${{ secrets.ALI_KEY_SECRET }} | ||
type: Directory | ||
path: https://cas.ziqiang.net.cn/ | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: PR CI | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.5.0 | ||
run_install: false | ||
- name: Use Node.js 22 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22.x | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Code lint | ||
run: pnpm lint | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.5.0 | ||
run_install: false | ||
- name: Use Node.js 22 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22.x | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build (Generate static files) | ||
run: pnpm generate |