From 31af95b3688c1843f104860af8844c0892ab9005 Mon Sep 17 00:00:00 2001 From: Kyle Wong <62775956+y3owk1n@users.noreply.github.com> Date: Sun, 7 Apr 2024 15:39:37 +0800 Subject: [PATCH] build: update production deployment workflow (#81) Exclude staging tags from triggering production deployment in the .production-by-tag workflow. Update to node.js version 20.x and pnpm version 8 for building project artifacts and deploying to Vercel. --- .github/workflows/production-by-tag.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/production-by-tag.yml diff --git a/.github/workflows/production-by-tag.yml b/.github/workflows/production-by-tag.yml new file mode 100644 index 0000000..b653c9d --- /dev/null +++ b/.github/workflows/production-by-tag.yml @@ -0,0 +1,38 @@ +name: Production Tag Deployment (Account) +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + # Pattern matched against refs/tags + tags-ignore: + - '*-staging*' # Exclude tags containing "staging" +jobs: + Deploy-Production-Account: + runs-on: ubuntu-latest + permissions: + contents: write + strategy: + matrix: + node-version: [20.x] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8 + run_install: false + - name: Install Vercel CLI + run: pnpm install -g 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 }}