Skip to content

chore: prepare release 2025-05-22 (#6) #10

chore: prepare release 2025-05-22 (#6)

chore: prepare release 2025-05-22 (#6) #10

Workflow file for this run

name: Vercel Production Deployment
on:
push:
# The conditions are OR conditions, so we must check the main branch later and cannot use the branch filter here.
# Also, regex is not fully supported for branch filters, so we must check the tag structure later.
tags:
- '*'
env:
VERCEL_TELEMETRY_DISABLED: 1
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
dependence_processed_variables:
name: Depend on Processed Variables
uses: ./.github/workflows/processed-variables.yml
check-tag-structure:
name: Check Tag Structure
needs:
- dependence_processed_variables
runs-on: ubuntu-latest
steps:
- name: Check Tag Name
uses: actions/github-script@v7
env:
TAG_NAME: ${{ needs.dependence_processed_variables.outputs.tagName }}
with:
script: |
const tagName = process.env.TAG_NAME
if (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}(-([^\.]+\.)?\d+)?$/.test(tagName)) {
const msg = `Tag named '${tagName}' triggering this workflow and it is not structured as date \
'YYYY-MM-DD' or 'YYYY-MM-DD-X.d', which is required. The workflow will now exit.`
core.setFailed(msg)
}
check-main-branch:
name: Check Main Branch
needs:
- dependence_processed_variables
runs-on: ubuntu-latest
steps:
- name: Check Main Branch
uses: actions/github-script@v7
env:
BRANCH_NAME: ${{ needs.dependence_processed_variables.outputs.branchName }}
with:
script: |
const branchName = process.env.BRANCH_NAME
if (branchName !== 'main') {
const msg = `This workflow was run on branch '${branchName}' and this is not the main branch, which \
is required. The workflow will now exit.`
core.setFailed(msg)
}
dependence-release:
name: Depend on Release
permissions:
contents: write
needs:
- check-tag-structure
- check-main-branch
uses: ./.github/workflows/release.yml
vercel-deploy-production:
name: Vercel Deploy Production
needs:
- dependence-release
runs-on: ubuntu-latest
steps:
- name: Checkout the Codebase
uses: actions/checkout@v4
# - name: Enable Corepack
# run: corepack enable
- name: Setup pnpm as package manager
uses: pnpm/action-setup@v3
with:
version: 9.15.4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: pnpm
- name: Install Vercel CLI
run: pnpm add --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
env:
VITE_ZLIG_DEMO_BASE_URL: ${{ vars.VITE_ZLIG_DEMO_BASE_URL }}
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}