forked from nrabulinski/attic
.github: Allow specifying alternative cache in secrets
This commit is contained in:
parent
982ff75cb2
commit
864b62652b
1 changed files with 12 additions and 6 deletions
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
@ -24,14 +24,22 @@ jobs:
|
||||||
trusted-users = root ${{ env.ACTION_USER }}
|
trusted-users = root ${{ env.ACTION_USER }}
|
||||||
|
|
||||||
- name: Install Attic
|
- name: Install Attic
|
||||||
run: ./.github/install-attic-ci.sh
|
run: |
|
||||||
|
if ! command -v attic &> /dev/null; then
|
||||||
|
./.github/install-attic-ci.sh
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Configure Attic
|
- name: Configure Attic
|
||||||
run: |
|
run: |
|
||||||
|
: "${ATTIC_SERVER:=https://staging.attic.rs/}"
|
||||||
|
: "${ATTIC_CACHE:=attic-ci}"
|
||||||
|
echo ATTIC_CACHE=$ATTIC_CACHE >>$GITHUB_ENV
|
||||||
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
|
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
|
||||||
attic login staging https://staging.attic.rs/ "$ATTIC_TOKEN"
|
attic login --set-default ci "$ATTIC_SERVER" "$ATTIC_TOKEN"
|
||||||
attic use attic-ci
|
attic use "$ATTIC_CACHE"
|
||||||
env:
|
env:
|
||||||
|
ATTIC_SERVER: ${{ secrets.ATTIC_SERVER }}
|
||||||
|
ATTIC_CACHE: ${{ secrets.ATTIC_CACHE }}
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||||
|
|
||||||
- name: Build and run tests
|
- name: Build and run tests
|
||||||
|
@ -47,7 +55,5 @@ jobs:
|
||||||
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
|
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
|
||||||
if [ -n "$ATTIC_TOKEN" ]; then
|
if [ -n "$ATTIC_TOKEN" ]; then
|
||||||
nix build .#internal."$system".attic-tests .#internal."$system".cargoArtifacts --no-link --print-out-paths -L | \
|
nix build .#internal."$system".attic-tests .#internal."$system".cargoArtifacts --no-link --print-out-paths -L | \
|
||||||
xargs attic push attic-ci
|
xargs attic push "ci:$ATTIC_CACHE"
|
||||||
fi
|
fi
|
||||||
env:
|
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
||||||
|
|
Loading…
Reference in a new issue