update
This commit is contained in:
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@@ -11,6 +11,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- id: commit-hash
|
||||||
|
uses: prompt/actions-commit-hash@v3
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ jobs:
|
|||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-output-${{ github.sha }}
|
name: build-output-${{ steps.commit-hash.outputs.short }}
|
||||||
path: .output/public
|
path: .output/public
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
@@ -50,23 +53,34 @@ jobs:
|
|||||||
- name: Upload generate artifact
|
- name: Upload generate artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: generate-output-${{ github.sha }}
|
name: generate-output-${{ steps.commit-hash.outputs.short }}
|
||||||
path: dist
|
path: dist
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
node_modules
|
||||||
|
~/.bun/install/cache
|
||||||
|
key: ${{ runner.os }}-build-${{ hashFiles('**/bun.lock') }}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- id: commit-hash
|
||||||
|
uses: prompt/actions-commit-hash@v3
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download generate artifact
|
- name: Download generate artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: generate-output-${{ github.sha }}
|
name: generate-output-${{ steps.commit-hash.outputs.short }}
|
||||||
path: artifact
|
path: artifact
|
||||||
|
|
||||||
- name: List artifact contents
|
- name: List artifact contents
|
||||||
@@ -79,8 +93,8 @@ jobs:
|
|||||||
- name: Prepare deployment
|
- name: Prepare deployment
|
||||||
run: |
|
run: |
|
||||||
bun install -g edgeone vercel wrangler
|
bun install -g edgeone vercel wrangler
|
||||||
unzip artifact/generate-output-${{ github.sha }}.zip -d artifact/generate-output-${{ github.sha }}
|
unzip artifact/generate-output-${{ steps.commit-hash.outputs.short }}.zip -d artifact/generate-output-${{ steps.commit-hash.outputs.short }}
|
||||||
cd artifact/generate-output-${{ github.sha }}
|
cd artifact/generate-output-${{ steps.commit-hash.outputs.short }}
|
||||||
|
|
||||||
- name: Deploy to Vercel
|
- name: Deploy to Vercel
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user