-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46a9cff
commit e95057c
Showing
4 changed files
with
77 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main # default branch | ||
|
||
jobs: | ||
pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: test/.vitepress/dist | ||
cname: tmfe.theojs.cn | ||
|
||
- name: Set DATE environment variable | ||
run: echo "DATE=$(TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV | ||
|
||
- name: Translate job status to Chinese | ||
id: translate-status | ||
run: | | ||
case "${{ job.status }}" in | ||
success) translated_status="成功" ;; | ||
failure) translated_status="失败" ;; | ||
cancelled) translated_status="取消" ;; | ||
*) translated_status="未知" ;; | ||
esac | ||
echo "translated_status=$translated_status" >> $GITHUB_ENV | ||
- name: Notify job status | ||
if: always() # 确保这一步始终运行,不管之前的步骤是否成功 | ||
run: | | ||
curl -X "POST" "${{ secrets.BARK_KEY }}" \ | ||
-H 'Content-Type: application/json; charset=utf-8' \ | ||
-d '{ | ||
"body": "${{ github.repository }}于${{ env.DATE }}运行${{ env.translated_status }}", | ||
"title": "Github Actions", | ||
"badge": 1, | ||
"category": "Github Actions", | ||
"sound": "multiwayinvitation.caf", | ||
"icon": "https://cdn.pixabay.com/photo/2022/01/30/13/33/github-6980894_1280.png", | ||
"group": "Github Actions" | ||
}' |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.