32 lines
990 B
YAML
32 lines
990 B
YAML
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
|
|
name: Cache
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: nix
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Write niks3 auth token
|
|
run: |
|
|
umask 077
|
|
printf '%s' "${{ secrets.NIKS3_AUTH_TOKEN }}" > "$RUNNER_TEMP/niks3-auth-token"
|
|
|
|
- name: Build all packages
|
|
run: |
|
|
nix-build --no-out-link | tee "$RUNNER_TEMP/built-paths"
|
|
|
|
- name: Push to niks3 cache
|
|
env:
|
|
NIKS3_SERVER_URL: https://cache.ekman.oceanbox.io
|
|
NIKS3_AUTH_TOKEN_FILE: ${{ runner.temp }}/niks3-auth-token
|
|
run: |
|
|
niks3="$(nix --extra-experimental-features 'nix-command flakes' \
|
|
build --no-link --print-out-paths 'github:Mic92/niks3/v1.6.1#niks3')/bin/niks3"
|
|
xargs -r "$niks3" push < "$RUNNER_TEMP/built-paths"
|