ci: Use cachix authtoken in CI (#1821)
This commit is contained in:
@@ -140,9 +140,16 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
# Only push to the cache when CircleCI makes the CACHIX_SIGNING_KEY
|
# Only push to the cache when CircleCI makes the CACHIX_SIGNING_KEY
|
||||||
# available (e.g. not for pull requests).
|
# available (e.g. not for pull requests).
|
||||||
if [ -n "${CACHIX_SIGNING_KEY:-""}" ]; then
|
if [ -n "${CACHIX_AUTH_TOKEN:-""}" ]; then
|
||||||
echo "Building and caching all derivations..."
|
echo "Building and caching all derivations..."
|
||||||
|
cachix authtoken "$CACHIX_AUTH_TOKEN"
|
||||||
|
|
||||||
|
# Push new builds as we go
|
||||||
nix-build | cachix push postgrest
|
nix-build | cachix push postgrest
|
||||||
|
|
||||||
|
# Make sure that everything, including .drv files, is pushed
|
||||||
|
nix-env -f default.nix -iA devtools
|
||||||
|
postgrest-push-cachix
|
||||||
else
|
else
|
||||||
echo "Building all derivations (caching skipped for outside pull requests)..."
|
echo "Building all derivations (caching skipped for outside pull requests)..."
|
||||||
nix-build
|
nix-build
|
||||||
|
|||||||
+6
-3
@@ -39,13 +39,16 @@ let
|
|||||||
docs = ''
|
docs = ''
|
||||||
Push all build artifacts to cachix.
|
Push all build artifacts to cachix.
|
||||||
|
|
||||||
Requires that the CACHIX_SIGNING_KEY for postgrest is set as an
|
Requires authentication with `cachix authtoken ...`.
|
||||||
environment variable.
|
|
||||||
'';
|
'';
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
nix-store -qR --include-outputs "$(nix-instantiate)" | cachix push postgrest
|
nix-instantiate \
|
||||||
|
| while read -r drv; do
|
||||||
|
nix-store -qR --include-outputs "$drv"
|
||||||
|
done \
|
||||||
|
| cachix push postgrest
|
||||||
'';
|
'';
|
||||||
|
|
||||||
build =
|
build =
|
||||||
|
|||||||
Reference in New Issue
Block a user