chore: update using dependabot #2
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: 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" | |
}' |