fix(deps): update dependency @sentry/nextjs to v8.47.0 #1305
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Web - Preview | |
on: | |
pull_request: | |
branches: | |
- master | |
env: | |
DEPLOY_ENV: preview | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN}} | |
jobs: | |
build-deploy-web: | |
name: Deploy Web Preview | |
environment: | |
name: preview | |
url: https://preview.coh3stats.com | |
concurrency: | |
group: preview-${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
if: github.repository == 'cohstats/coh3-stats' | |
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: Run the build | |
run: yarn build | |
- name: Deploy to Vercel hosting | |
if: ${{ !startsWith(github.head_ref, 'renovate/') }} | |
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 | |
# On vercel, development env is what we used to call preview | |
npx vercel pull --yes --environment=development --token=$VERCEL_TOKEN | |
npx vercel build --token=$VERCEL_TOKEN | |
npx vercel deploy --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 preview.coh3stats.com --token=$VERCEL_TOKEN --scope cohstats | |
echo "DEPLOYMENT_URL=$(cat deployment-url.txt)" >> $GITHUB_ENV | |
else | |
# Handle the error | |
errorMessage=`cat error.txt` | |
echo "There was an error: $errorMessage" | |
fi | |
- uses: jwalton/gh-find-current-pr@v1 | |
id: finder | |
- name: Publish Preview Link | |
if: ${{ !startsWith(github.head_ref, 'renovate/') }} | |
uses: marocchino/[email protected] | |
with: | |
number: ${{ steps.finder.outputs.pr }} | |
header: preview | |
message: | | |
🌐 Branch deployed as preview to: | |
${{ env.DEPLOYMENT_URL }} | |
# lighthouse: | |
# name: Lighthouse report | |
# runs-on: ubuntu-latest | |
# needs: build-deploy-web | |
# if: ${{ !startsWith(github.head_ref, 'renovate/') }} | |
# steps: | |
# - name: Fireup the preview enviroment with request | |
# run: | | |
# curl -H 'Content-Type: application/json' -H 'lighthouse: report' https://preview.coh3stats.com | |
# - run: mkdir -p ${{ github.workspace }}/tmp/artifacts | |
# - name: Lighthouse | |
# uses: foo-software/lighthouse-check-action@master | |
# with: | |
# outputDirectory: ${{ github.workspace }}/tmp/artifacts | |
# urls: https://preview.coh3stats.com | |
# extraHeaders: '{ "lighthouse": "report" }' | |
# prCommentEnabled: true | |
# device: all | |
# gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@master | |
# with: | |
# name: Lighthouse reports | |
# path: ${{ github.workspace }}/tmp/artifacts |