From 9134171b959e732e3725f620bd9748049e05fc41 Mon Sep 17 00:00:00 2001 From: Remo <59358383+monacoremo@users.noreply.github.com> Date: Tue, 28 Apr 2020 21:04:06 +0200 Subject: [PATCH] Fix the cachix push logic in CircleCI Before pushing to cachix, check if the CACHIX_SIGNING_KEY env var is available. --- .circleci/config.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 053f8df92..18c57b580 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -423,11 +423,9 @@ jobs: - run: name: Build all derivations from default.nix and push results to Cachix command: | - # We only push to the binary cache if the trigger for the build was not a pull request - # or if the pull request was from an internal branch. CircleCI is configured to not make - # the CACHIX_SIGNING_KEY secret, which is required for pushing to the cache, available to - # any other builds. - if [ -z "${CI_PULL_REQUEST:-""}" ] || [ "${CIRCLE_PR_USERNAME:-""}" == "PostgREST" ]; then + # Only push to the cache when CircleCI makes the CACHIX_SIGNING_KEY available (e.g. not for + # pull requests). + if [ -n "${CACHIX_SIGNING_KEY:-""}" ]; then echo "Building and caching all derivations..." nix-build | cachix push postgrest else