Skip to content

Update sitemap (#672) #162

Update sitemap (#672)

Update sitemap (#672) #162

Workflow file for this run

name: Build and Deploy Web - PROD
on:
push:
tags:
- v*
env:
DEPLOY_ENV: prod
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN}}
jobs:
build-deploy-web:
name: Deploy Web Prod
environment:
name: prod
url: https://coh3stats.com
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: "20.x"
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules-v2
with:
path: |
node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Deps
run: yarn --prefer-offline --frozen-lockfile install
- name: Disable Vercel telemetry
run: yarn next telemetry disable
- name: Create Sentry release
uses: getsentry/action-release@master
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: coh-stats
SENTRY_PROJECT: coh3-stats-web
with:
environment: ${{ env.DEPLOY_ENV }}
ignore_empty: true
ignore_missing: true
- name: Deploy to Netlify hosting
env:
NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID_PROD}}
NODE_VERSION: "20.x"
run: |
npx netlify --telemetry-disable
netlify deploy --build --prod
- name: Deploy to Vercel hosting
env:
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID}}
VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID}}
run: |
npx vercel telemetry disable
npx vercel pull --yes --environment=production --token=$VERCEL_TOKEN
npx vercel build --prod --token=$VERCEL_TOKEN
npx vercel deploy --prod --prebuilt --token=$VERCEL_TOKEN >deployment-url.txt 2>error.txt
code=$?
if [ $code -eq 0 ]; then
# Now you can use the deployment url from stdout for the next step of your workflow
deploymentUrl=`cat deployment-url.txt`
npx vercel alias $deploymentUrl coh3stats.com --token=$VERCEL_TOKEN --scope cohstats
else
# Handle the error
errorMessage=`cat error.txt`
echo "There was an error: $errorMessage"
fi