From 07b1170e130df2f32051fd6a9955ded53d3a8645 Mon Sep 17 00:00:00 2001 From: roziqinkhoeru Date: Mon, 1 Jan 2024 12:58:01 +0700 Subject: [PATCH] `ci` make github actions to deploy on vercel --- .github/workflows/preview.yml | 24 ++++++++++++++++++++++++ .github/workflows/production.yml | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/preview.yml create mode 100644 .github/workflows/production.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..7c6e6fb --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,24 @@ +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: + Deploy-Preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Vercel CLI + run: npm i -g vercel + - name: Pull Version Environment Information + run: vercel pull --yes --environment=preview --token=${{secrets.VERCEL_TOKEN}} + - name: Build Project Artifacts + run: vercel build --token=${{secrets.VERCEL_TOKEN}} + - name: Deplot Project Artifacts + run: vercel deploy --prebuilt --token=${{secrets.VERCEL_TOKEN}} diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 0000000..3a95c38 --- /dev/null +++ b/.github/workflows/production.yml @@ -0,0 +1,24 @@ +name: Vercel Production Deployment + +env: + VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID}} + VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID}} + +on: + push: + branches: + - main + +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Vercel CLI + run: npm i -g vercel + - name: Pull Version 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: Deplot Project Artifacts + run: vercel deploy --prebuilt --prod --token=${{secrets.VERCEL_TOKEN}}