Files
profile/.gitea/workflows/main.yml
bisnsh 85e3d5c86b
All checks were successful
Astro 自动部署 / deploy (push) Successful in 26s
fix
2026-02-18 20:33:38 +08:00

53 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Astro 自动部署
on:
push:
branches:
- master
release:
types:
- published
workflow_dispatch:
env:
TZ: Asia/Shanghai
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 检查分支
uses: actions/checkout@v4
with:
ref: master
- name: 安装 Node
uses: actions/setup-node@v4
with:
node-version: "22.x"
# 如果你使用 npm开启缓存可以省去手动配置 actions/cache
cache: 'npm'
- name: 安装依赖
run: |
npm install
- name: 生成静态文件
run: |
# Astro 默认的构建命令
npm run build
- name: 部署
run: |
# 注意Astro 默认输出目录是 distHexo 是 public
cd ./dist
git init
git config user.name "${{ gitea.actor }}"
git config user.email "${{ gitea.actor }}@noreply.gitea.io"
git add .
git commit -m "${{ gitea.event.head_commit.message }} ·· [$(date +"%Z %Y-%m-%d %A %H:%M:%S")]"
# 强制推送到远程仓库的 page 分支
git push --force --quiet "https://${{ gitea.actor }}:${{ secrets.DEPLOY_TOKEN }}@git.biss.click/biss/profile.git" master:page
- name: Webhook 通知服务器
run: |
# curl -k -X POST "https://panel.biss.click/hook?access_key=1XJG8IvYTSZVvD5dpm86GYIpQxgxBcucULnX1MFskZSKayXU"