This commit is contained in:
parent
2a091f3b59
commit
f58d32e631
2 changed files with 13 additions and 46 deletions
33
.github/actions/attic-cache-push/action.yml
vendored
33
.github/actions/attic-cache-push/action.yml
vendored
|
@ -1,33 +0,0 @@
|
||||||
name: "Attic Watch and Push"
|
|
||||||
description: "Composite action that logs in, sets the cache repository, starts attic watch-store in the background, and pushes results after the job completes."
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
cache_name:
|
|
||||||
description: "Cache name for attic login"
|
|
||||||
required: true
|
|
||||||
server:
|
|
||||||
description: "Server URL for attic login"
|
|
||||||
required: true
|
|
||||||
attic_auth_token:
|
|
||||||
description: "Authentication token for attic login"
|
|
||||||
required: true
|
|
||||||
cache_repository:
|
|
||||||
description: "Cache repository to use with attic"
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Attic Login
|
|
||||||
shell: "nix shell nixpkgs#attic-client --command {0}"
|
|
||||||
run: |
|
|
||||||
attic login "${{ inputs.cache_name }}" "${{ inputs.server }}" "${{ inputs.attic_auth_token }}"
|
|
||||||
- name: Attic Use Repository
|
|
||||||
shell: "nix shell nixpkgs#attic-client --command {0}"
|
|
||||||
run: |
|
|
||||||
attic use "${{ inputs.cache_repository }}"
|
|
||||||
- name: Start Attic Watch-Store in Background
|
|
||||||
shell: "nix shell nixpkgs#attic-client --command {0}"
|
|
||||||
run: |
|
|
||||||
# Start attic watch-store in the background
|
|
||||||
attic watch-store &
|
|
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
|
@ -3,9 +3,14 @@ name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: nix develop --command bash -c "{0}"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: nix
|
runs-on: nix
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Initialize CI
|
- name: Initialize CI
|
||||||
uses: https://git.qo.is/qo.is/actions-nix-init@main
|
uses: https://git.qo.is/qo.is/actions-nix-init@main
|
||||||
|
@ -13,20 +18,15 @@ jobs:
|
||||||
token: ${{ secrets.CI_TOKEN }}
|
token: ${{ secrets.CI_TOKEN }}
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Add submodules to nix store to circumvent another nix bug
|
- name: Setup Attic Cache
|
||||||
|
env:
|
||||||
|
CACHE_NAME: fabianhauser
|
||||||
|
CACHE_REPOSITORY: fabianhauser:dotfiles
|
||||||
|
SERVER: https://attic.qo.is/
|
||||||
|
ATTIC_AUTH_TOKEN: ${{ secrets.ATTIC_AUTH_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git clone https://git.qo.is/fabianhauser/nix-config-private.git /tmp/private
|
attic login "$CACHE_NAME" "$SERVER" "$ATTIC_AUTH_TOKEN"
|
||||||
cd /tmp/private
|
attic use "$CACHE_REPOSITORY"
|
||||||
nix flake prefetch
|
|
||||||
|
|
||||||
- name: Setup Attic Watch and Push
|
|
||||||
uses: ./.github/actions/attic-cache
|
|
||||||
with:
|
|
||||||
cache_name: fabianhauser
|
|
||||||
server: https://attic.qo.is/
|
|
||||||
attic_auth_token: ${{ secrets.ATTIC_AUTH_TOKEN }}
|
|
||||||
cache_repository: fabianhauser:dotfiles
|
|
||||||
|
|
||||||
- name: Run Checks
|
- name: Run Checks
|
||||||
shell: nix develop --command bash -c "{0}"
|
|
||||||
run: nix-fast-build --skip-cached --attic-cache fabianhauser:dotfiles
|
run: nix-fast-build --skip-cached --attic-cache fabianhauser:dotfiles
|
||||||
|
|
Loading…
Add table
Reference in a new issue