Skip to content

Commit 1f7561a

Browse files
Update deploy.yml
1 parent 19172a7 commit 1f7561a

23 files changed

Lines changed: 54 additions & 1522 deletions

‎.github/workflows/deploy.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build & Deploy Astro to AWS
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build-deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js 20
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Build Astro site
29+
run: npm run build
30+
31+
# 上传到腾讯云 COS (S3 兼容方式)
32+
- name: Upload to COS (Tencent Cloud)
33+
uses: Robert-Stackflow/upload-s3-action@master
34+
with:
35+
endpoint: ${{ secrets.AWS_ENDPOINT }} # 例如:https://cos.ap-guangzhou.myqcloud.com
36+
aws_key_id: ${{ secrets.AWS_SECRET_ID }} # 腾讯云 API 密钥
37+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38+
aws_bucket: ${{ secrets.AWS_BUCKET }} # 存储桶名称,如 example-bucket
39+
source_dir: dist # Astro 输出目录
40+
destination_dir: / # 上传到桶的根目录,可改为指定文件夹
41+
42+
# 发送 PushPlus 通知
43+
- name: Send PushPlus Notification
44+
if: always() # 无论成功或失败都执行
45+
run: |
46+
curl -X POST \
47+
-H "Content-Type: application/json" \
48+
-d '{
49+
"token": "${{ secrets.PUSHPLUS_TOKEN }}",
50+
"title": "🚀 Astro 部署完成",
51+
"content": "项目已构建并上传至 AWS(分支:${{ github.ref_name }})\n状态:${{ job.status }}",
52+
"template": "txt"
53+
}' \
54+
https://www.pushplus.plus/send

‎src/content/post/ai-remove-image-background.md‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎src/content/post/astro-aria.md‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎src/content/post/broadcast-channel.md‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎src/content/post/cloudflare-audio-concat.md‎

Lines changed: 0 additions & 125 deletions
This file was deleted.

‎src/content/post/cloudflare-pypi-mirror.md‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎src/content/post/cloudflare-web-analytics-kill-adblock.md‎

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)