This commit is contained in:
2026-01-18 16:11:22 +08:00
parent 80f29c0e42
commit 770b39d776

View File

@@ -10,6 +10,7 @@ on:
env: env:
EDGEONE_PROJECT_NAME: blog1 EDGEONE_PROJECT_NAME: blog1
ESA_PROJECT_NAME: cloud-blog ESA_PROJECT_NAME: cloud-blog
CLOUDFLARE_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 }}
@@ -96,8 +97,8 @@ jobs:
with: with:
node-version: 24 node-version: 24
- name: Install Bun # - name: Install Bun
uses: oven-sh/setup-bun@v2 # uses: oven-sh/setup-bun@v2
- name: Download generate artifact - name: Download generate artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
@@ -107,7 +108,7 @@ jobs:
- name: Install ESA CLI - name: Install ESA CLI
run: | run: |
bun install -g esa-cli npm install -g esa-cli
- name: Deploy to ESA - name: Deploy to ESA
run: | run: |
@@ -179,52 +180,42 @@ jobs:
fi fi
edgeone pages deploy ./dist --token ${{ secrets.EDGEONE_TOKEN }} --name "${{ env.EDGEONE_PROJECT_NAME }}" edgeone pages deploy ./dist --token ${{ secrets.EDGEONE_TOKEN }} --name "${{ env.EDGEONE_PROJECT_NAME }}"
# deploy-cloudflare: deploy-cloudflare:
# needs: build needs: build
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: ${{ github.event_name == 'push' && secrets.CLOUDFLARE_API_TOKEN != '' && secrets.CLOUDFLARE_ACCOUNT_ID != '' && secrets.CLOUDFLARE_PROJECT_NAME != '' }} if: ${{ github.event_name == 'push' }}
# steps: steps:
# - id: commit-hash - id: commit-hash
# uses: prompt/actions-commit-hash@v3 uses: prompt/actions-commit-hash@v3
# - name: Checkout - name: Checkout
# uses: actions/checkout@v4 uses: actions/checkout@v4
# - name: Download generate artifact - name: Install Node.js
# uses: actions/download-artifact@v4 uses: actions/setup-node@v4
# with: with:
# name: generate-output-${{ steps.commit-hash.outputs.short }} node-version: 24
# path: dist
# - name: Deploy to Cloudflare Pages - name: Install Bun
# uses: cloudflare/pages-action@v1 uses: oven-sh/setup-bun@v2
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
# directory: dist
# deploy-aliyun: - name: Download generate artifact
# needs: build uses: actions/download-artifact@v4
# runs-on: ubuntu-latest with:
# if: ${{ github.event_name == 'push' && secrets.ALIYUN_ESA_DEPLOY_URL != '' && secrets.ALIYUN_ESA_TOKEN != '' }} name: generate-output-${{ steps.commit-hash.outputs.short }}
path: dist
# steps: - name: Install Cloudflare CLI
# - id: commit-hash run: |
# uses: prompt/actions-commit-hash@v3 npm install -g wrangler
# - name: Checkout - name: Deploy to Cloudflare Pages
# uses: actions/checkout@v4 uses: cloudflare/wrangler-action@v3
with:
# - name: Download generate artifact apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# uses: actions/download-artifact@v4 accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# with: command: pages deploy ./dist --project-name="${{ env.CLOUDFLARE_PROJECT_NAME }}"
# name: generate-output-${{ steps.commit-hash.outputs.short }}
# path: dist
# - name: Package and Deploy to Aliyun ESA
# run: | # run: |
# cd dist || exit 1 # wrangler login --api-token ${{ secrets.CLOUDFLARE_API_TOKEN }}
# zip -r ../dist-deploy.zip . # wrangler deploy --name ${{ env.CLOUDFLARE_PROJECT_NAME }} --assets ./dist
# curl -v -X POST -H "Authorization: Bearer ${{ secrets.ALIYUN_ESA_TOKEN }}" -F "file=@../dist-deploy.zip" ${{ secrets.ALIYUN_ESA_DEPLOY_URL }}