Skip to content

Update machines

Update machines #74

Workflow file for this run

name: "Update"
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '30 04 * * MON' # runs weekly on Monday at 04:30
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Install nix-build-uncached
run: nix-env -f '<nixpkgs>' -iA nix-build-uncached
- uses: cachix/cachix-action@v12
with:
name: jakobkukla
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Update flake.lock and build
id: build
run: |
nix flake update
nix-build-uncached ./ci.nix
- name: Commit flake.lock on success
if: steps.build.outcome == 'success'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'base: update packages'
file_pattern: 'flake.lock'
# FIXME: This is bad
- name: Prevent cachix from pushing on failure
if: failure() && steps.build.outcome == 'failure'
run: /usr/bin/sh -c /home/runner/work/_actions/cachix/cachix-action/v12/dist/main/list-nix-store.sh > /tmp/store-path-pre-build