From ee653addc8eace074482f1aad1390971ce93c237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A9o=20GUILBERT?= Date: Tue, 9 Jun 2026 09:34:30 +0200 Subject: [PATCH] add a gitea action for deployment to vercel --- .gitea/workflows/deploy-vercel.yml | 99 ++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .gitea/workflows/deploy-vercel.yml diff --git a/.gitea/workflows/deploy-vercel.yml b/.gitea/workflows/deploy-vercel.yml new file mode 100644 index 0000000..d06f7a0 --- /dev/null +++ b/.gitea/workflows/deploy-vercel.yml @@ -0,0 +1,99 @@ +name: Deploy Vercel + +on: + push: + branches: + - main + - dev + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install + run: npm ci + + # - name: Lint + # run: npm run lint --if-present + + # - name: Test + # run: npm test --if-present + + deploy-preprod: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/dev' + + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install + run: npm ci + + - name: Install Vercel CLI + run: npm install -g vercel + + - name: Pull Vercel environment + run: vercel pull --yes --environment=preview + + - name: Build for preprod + run: vercel build + + - name: Deploy preprod + run: vercel deploy --prebuilt --archive=tgz + + deploy-production: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install + run: npm ci + + - name: Install Vercel CLI + run: npm install -g vercel + + - name: Pull Vercel production environment + run: vercel pull --yes --environment=production + + - name: Build for production + run: vercel build --prod + + - name: Deploy production + run: vercel deploy --prebuilt --prod --archive=tgz \ No newline at end of file