Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove Next.js build cache from preview.yml #1183

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build-preview.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build Preview Deployment

on:
on:
pull_request:
types: [opened, synchronize]

Expand Down Expand Up @@ -52,7 +52,10 @@ jobs:

- name: Install dependencies
run: yarn install --immutable


- name: Remove Next.js build cache
run: rm -rf .next/cache

- name: Build Site
run: yarn run build
env:
Expand Down
5 changes: 5 additions & 0 deletions pages/tools/lib/postAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export async function postAnalytics({
eventPayload,
}: AnalyticsParams) {
try {
if (process.env.NODE_ENV !== 'production') {
console.log('Analytics event is disabled in development mode.');
return;
}

const deviceType = /Mobi/.test(navigator.userAgent) ? 'Mobile' : 'Desktop';

const response = await fetch(
Expand Down
Loading