Skip to content

Commit 6de6c4f

Browse files
authored
chore(ci): improve vercel build step script (#84)
Ports PR iotaledger/iota#11188 # Description of change 1. Skip `gh-pages` branch since they always fail. Reference https://vercel.com/docs/environment-variables/system-environment-variables#VERCEL_GIT_COMMIT_REF 2. remove `turbo-ignore`, it's now deprecated https://turborepo.dev/docs/reference/query#migrating-from-turbo-ignore ## Links to any relevant issues Be sure to reference any related issues by adding `fixes #(issue)`. ## How the change has been tested Describe the tests that you ran to verify your changes. Make sure to provide instructions for the maintainer as well as any relevant configurations.
1 parent 85b768d commit 6de6c4f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
22
# This script is meant to be run from the "Ignored Build Step" in Vercel.
33

4-
npx turbo-ignore --fallback=HEAD^1
4+
PACKAGE_NAME="$(pnpm pkg get name | tr -d '"')"
5+
6+
pnpx turbo query affected --packages "$PACKAGE_NAME" --base=HEAD^1 --exit-code

scripts/vercel/ignore-build-step-previews.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/bin/bash
22
# This script is meant to be run from the "Ignored Build Step" in Vercel.
33

4-
if [ "$VERCEL_ENV" == "preview" ]; then
4+
if [ "$VERCEL_GIT_COMMIT_REF" == "gh-pages" ]; then
5+
echo "❌ - gh-pages branch detected. Skipping deploy."
6+
exit 0
7+
elif [ "$VERCEL_ENV" == "preview" ]; then
58
echo "✅ - Preview environment detected. Checking for changes in apps..."
69
# Relative to the root directory of the project. E.g relative to apps/wallet-dashboard
7-
bash ../../scripts/vercel/ignore-build-step-base.sh
10+
bash ../../scripts/tooling/vercel/ignore-build-step-base.sh
811
else
912
echo "❌ - Not a preview deployment."
1013
exit 0

0 commit comments

Comments
 (0)