Skip to content

Merge pull request #383 from samternent/changeset-release/main #553

Merge pull request #383 from samternent/changeset-release/main

Merge pull request #383 from samternent/changeset-release/main #553

name: Production Tag Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FOOTBALL_SOCIAL_PROJECT_ID }}
PNPM_CACHE_PATH: ~/.pnpm-store
PNPM_CACHE_NAME: pnpm-store-cache
on:
push:
tags:
- "footballsocial-[0-9]+.[0-9]+.[0-9]+"
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@master
with:
fetch-depth: 0
persist-credentials: false
- name: Get branch name
id: branch
run: |
echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get node version
id: nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build libs
run: pnpm --filter ternent-ui --filter footballsocial build
- name: Link Vercel project
run: vercel link --yes --cwd ${{ github.workspace }}/apps/footballsocial --token=${{ secrets.VERCEL_TOKEN }}
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --cwd ${{ github.workspace }}/apps/footballsocial --token=${{ secrets.VERCEL_TOKEN }}
- name: Link Vercel project to root
run: cp -r ${{ github.workspace }}/apps/footballsocial/.vercel ${{ github.workspace }}/
- name: Bbuild Vercel Environment Information
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Update app version in Redis
run: node .ops/update-redis-version.mjs
env:
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
REDIS_ENDPOINT_URI: ${{ secrets.REDIS_ENDPOINT_URI }}