From 61c4daffb92a7244ad7f0bb828aded65093f8d54 Mon Sep 17 00:00:00 2001 From: Felipe Beserra Date: Sat, 2 Sep 2023 22:48:49 -0300 Subject: [PATCH] Ops, npm instead of yarn --- .github/workflows/deploy.yml | 30 ++++++++++++++---------------- .github/workflows/preview.yml | 34 +++++++++++++++------------------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b47242..727b98b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,23 +1,21 @@ -# .github/workflows/deploy.yml -name: deploy +name: Vercel Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: push: branches: - main - workflow_dispatch: -env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} jobs: - deploy: + Deploy-Production: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: yarn - - run: yarn install --immutable - - run: yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - run: yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - run: yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} + - uses: actions/checkout@v2 + - 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 }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0127f0c..f75c963 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,25 +1,21 @@ -# .github/workflows/preview.yml -name: preview -on: - pull_request: - workflow_dispatch: +name: Vercel Preview Deployment env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main jobs: - preview: + Deploy-Preview: runs-on: ubuntu-latest - environment: - name: preview - url: ${{ steps.deploy.outputs.url }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - - run: yarn install --immutable - - run: yarn vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - - run: yarn vercel build --token=${{ secrets.VERCEL_TOKEN }} - - id: deploy - run: echo "::set-output name=url::$(yarn vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" + - uses: actions/checkout@v2 + - 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 }}