From baa1675a1e2fc745296befe1e32a8e395b063505 Mon Sep 17 00:00:00 2001 From: Elias da Rosa Date: Sun, 10 Mar 2024 18:47:08 -0300 Subject: [PATCH] feat: add vercel deployment --- .github/workflows/vercel-preview.yml | 22 ++++++++++++++++++++++ .github/workflows/vercel-production.yml | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/vercel-preview.yml create mode 100644 .github/workflows/vercel-production.yml diff --git a/.github/workflows/vercel-preview.yml b/.github/workflows/vercel-preview.yml new file mode 100644 index 0000000..51df659 --- /dev/null +++ b/.github/workflows/vercel-preview.yml @@ -0,0 +1,22 @@ +name: Preview Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main + +jobs: + Deploy-Preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Vercel CLI + run: npm install --global vercel@canary + - 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/vercel-production.yml b/.github/workflows/vercel-production.yml new file mode 100644 index 0000000..8f98eb3 --- /dev/null +++ b/.github/workflows/vercel-production.yml @@ -0,0 +1,22 @@ +name: Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Vercel CLI + run: npm install --global vercel@canary + - 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