This commit is contained in:
2026-01-18 15:43:55 +08:00
parent 33c214091a
commit 80f29c0e42

View File

@@ -9,6 +9,7 @@ on:
env: env:
EDGEONE_PROJECT_NAME: blog1 EDGEONE_PROJECT_NAME: blog1
ESA_PROJECT_NAME: cloud-blog
GIT_DATE: ${{ github.event.head_commit.timestamp || github.event.pusher.date }} GIT_DATE: ${{ github.event.head_commit.timestamp || github.event.pusher.date }}
GIT_SHA: ${{ github.event.head_commit.id || github.sha }} GIT_SHA: ${{ github.event.head_commit.id || github.sha }}
@@ -78,6 +79,41 @@ jobs:
~/.bun/install/cache ~/.bun/install/cache
key: ${{ runner.os }}-build-${{ hashFiles('**/bun.lock') }} key: ${{ runner.os }}-build-${{ hashFiles('**/bun.lock') }}
deploy-esa:
needs: build
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- id: commit-hash
uses: prompt/actions-commit-hash@v3
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Download generate artifact
uses: actions/download-artifact@v4
with:
name: generate-output-${{ steps.commit-hash.outputs.short }}
path: dist
- name: Install ESA CLI
run: |
bun install -g esa-cli
- name: Deploy to ESA
run: |
esa-cli login --access-key-id ${{ secrets.ESA_ACCESS_KEY_ID }} --access-key-secret ${{ secrets.ESA_ACCESS_KEY_SECRET }}
esa-cli deploy --assets ./dist --name ${{ env.ESA_PROJECT_NAME }} --minify
deploy-vercel: deploy-vercel:
needs: build needs: build
if: ${{ github.event_name == 'push'}} if: ${{ github.event_name == 'push'}}