From c94a73451ab32b93cf67afb8500e2283666ecc89 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Wed, 22 Nov 2023 21:19:13 +0000 Subject: [PATCH] Move Vercel deployment to GitHub workflow --- .github/workflows/deploy-preview.yml | 27 +++++++++++++++++++++++++ .github/workflows/deploy-production.yml | 22 ++++++++++++++++++++ vercel.json | 1 + 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/deploy-preview.yml create mode 100644 .github/workflows/deploy-production.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 0000000..eaf1538 --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,27 @@ +name: Vercel Deploy Preview +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main + pull_request: + branches: + - main + +jobs: + deploy-preview: + name: Build and Deploy Preview + runs-on: ubuntu-latest + environment: preview + steps: + - uses: actions/checkout@v4 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - 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 }} \ No newline at end of file diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 0000000..5a50c19 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,22 @@ +name: Vercel Deploy Production +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + deploy-production: + name: Build and Deploy Production + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - 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 }} \ No newline at end of file diff --git a/vercel.json b/vercel.json index ad258d6..bf0ac2c 100644 --- a/vercel.json +++ b/vercel.json @@ -1,5 +1,6 @@ { "github": { + "enabled": false, "silent": true } } \ No newline at end of file