From 06bbfd5545c934d2d2a9b70b5454e34af20fa0a8 Mon Sep 17 00:00:00 2001 From: liuqiang Date: Fri, 22 Nov 2024 17:16:04 +0800 Subject: [PATCH] add github workflow files --- .github/workflows/preview.yaml | 23 +++++++++++++++++++++++ .github/workflows/production.yaml | 23 +++++++++++++++++++++++ .gitignore | 1 + 3 files changed, 47 insertions(+) create mode 100644 .github/workflows/preview.yaml create mode 100644 .github/workflows/production.yaml diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 0000000..3883690 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,23 @@ +name: GitHub Actions Vercel Preview Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - master +jobs: + Deploy-Preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Pnpm + run: npm install --global pnpm + - name: Install Vercel CLI + run: npm install --global vercel + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 0000000..6f67a6f --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,23 @@ +name: GitHub Actions Vercel Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - master +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Pnpm + run: npm install --global pnpm + - name: Install Vercel CLI + run: npm install --global vercel + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.gitignore b/.gitignore index 68aea7d..c18b947 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ pnpm-debug.log* # misc .DS_Store +.vercel