Update deploy.yml

This commit is contained in:
Vaica committed 2026-06-30 10:31:50 +08:00
1 parent 7b126b58e3
commit 98b9584b97
1 file changed
+34 -27
+34 -27
View File
@@ -358,15 +358,28 @@ jobs:
id: start-edgeone
run: echo "start_time=$(date +%s)" >> $GITHUB_OUTPUT
- name: Get build hash from COS (public URL)
id: hash
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install coscmd
run: pip install -U coscmd
- name: Configure coscmd
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_REGION: ${{ secrets.COS_REGION }}
run: coscmd config -a $COS_SECRET_ID -s $COS_SECRET_KEY -b $COS_BUCKET -r $COS_REGION
- name: Get build hash from COS
id: hash
run: |
COS_URL="https://${COS_BUCKET}.cos.${COS_REGION}.myqcloud.com/__build_hash"
echo "🔍 从腾讯云 COS 获取上次部署的 hash..."
LAST_HASH=$(curl -sL "$COS_URL" 2>/dev/null || echo "")
coscmd download /__build_hash /tmp/last_hash 2>/dev/null || echo ""
LAST_HASH=$(cat /tmp/last_hash 2>/dev/null || echo "")
if [ -z "$LAST_HASH" ]; then
echo "⚠️ 没有找到上次部署的 hash(首次部署)"
else
@@ -397,25 +410,6 @@ jobs:
with:
fetch-depth: 1
- name: Setup Python
if: steps.check.outputs.deployed == 'true'
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install coscmd
if: steps.check.outputs.deployed == 'true'
run: pip install -U coscmd
- name: Configure coscmd
if: steps.check.outputs.deployed == 'true'
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_REGION: ${{ secrets.COS_REGION }}
run: coscmd config -a $COS_SECRET_ID -s $COS_SECRET_KEY -b $COS_BUCKET -r $COS_REGION
- name: Download files from COS
if: steps.check.outputs.deployed == 'true'
id: download-files
@@ -488,15 +482,28 @@ jobs:
id: start-upyun
run: echo "start_time=$(date +%s)" >> $GITHUB_OUTPUT
- name: Get build hash from COS (public URL)
id: hash
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install coscmd
run: pip install -U coscmd
- name: Configure coscmd
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_REGION: ${{ secrets.COS_REGION }}
run: coscmd config -a $COS_SECRET_ID -s $COS_SECRET_KEY -b $COS_BUCKET -r $COS_REGION
- name: Get build hash from COS
id: hash
run: |
COS_URL="https://${COS_BUCKET}.cos.${COS_REGION}.myqcloud.com/__build_hash"
echo "🔍 从腾讯云 COS 获取 hash..."
CURRENT_HASH=$(curl -sL "$COS_URL" 2>/dev/null || echo "")
coscmd download /__build_hash /tmp/current_hash 2>/dev/null || echo ""
CURRENT_HASH=$(cat /tmp/current_hash 2>/dev/null || echo "")
echo "当前 build_hash: $CURRENT_HASH"
echo "current_hash=${CURRENT_HASH}" >> $GITHUB_OUTPUT