diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 1c2dbd80..b851cd3b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -34,7 +34,12 @@ jobs: CONTEXT: deploy-preview NETLIFY: true run: | + # Remove any existing headers + rm -f ./static/_headers + rm -f ./build/_headers yarn build + # Add preview headers after build + cp ./custom-headers/_previewHeaders ./build/_headers - name: Deploy to Netlify uses: jsmrcaga/action-netlify-deploy@v2.0.0 diff --git a/netlify.toml b/netlify.toml index e14829a3..e20cce1b 100644 --- a/netlify.toml +++ b/netlify.toml @@ -633,10 +633,4 @@ force = true from = "/pricing/" to = "/enterprise/" status = 301 -force = true - -[context.production] -command = "npm run build && cp ./custom-headers/_productionHeaders ./build/_headers" - -[context.deploy-preview] -command = "yarn build && cp ./custom-headers/_previewHeaders ./build/_headers" \ No newline at end of file +force = true \ No newline at end of file