nix/.forgejo/workflows/update-flake-lock.yml

64 lines
1.6 KiB
YAML
Raw Normal View History

2023-10-03 14:49:47 +02:00
name: update-flake-lock
run-name: ${{ github.actor }} - update-flake-lock
2023-10-04 15:24:22 +02:00
#on:
# push:
# branches:
# main
2023-10-04 11:32:38 +02:00
# I guess scheduling is in v1.21:
# https://codeberg.org/forgejo/forgejo/issues/741
2023-10-04 03:02:26 +02:00
# on:
# schedule:
# - cron: '*/5 * * * *'
2023-10-02 12:08:16 +02:00
jobs:
2023-10-03 14:49:47 +02:00
update-flake-lock:
2023-10-02 12:08:16 +02:00
runs-on: docker
2023-10-03 13:47:28 +02:00
container:
2023-10-03 14:07:16 +02:00
image: alpine:edge
2023-10-02 12:08:16 +02:00
steps:
2023-10-03 13:53:46 +02:00
- name: "Setup Runner"
run: |
apk update
2023-10-04 02:42:45 +02:00
apk add git nodejs nix \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
2023-10-04 02:51:24 +02:00
git config --global user.email "${{github.actor}}"
git config --global user.name "Albert J. Copeland"
- uses: https://code.forgejo.org/actions/checkout@v3
2023-10-03 04:20:52 +02:00
with:
2023-10-03 04:24:04 +02:00
sparse-checkout: |
2023-10-03 05:09:40 +02:00
.forgejo
2023-10-03 04:24:04 +02:00
home-manager
lib
nixos
flake.lock
flake.nix
shell.nix
2023-10-03 07:11:21 +02:00
- name: "Directory Structure"
2023-10-03 04:47:57 +02:00
run: |
2023-10-03 05:11:56 +02:00
ls ${{ github.workspace }}/*
2023-10-03 12:42:17 +02:00
- name: "Runner: Node Info"
run: |
id
uname -a
hostname
2023-10-03 14:00:28 +02:00
cat /etc/os-release
2023-10-03 14:10:47 +02:00
- name: "Nix Version"
run: |
nix --version
2023-10-04 03:29:20 +02:00
- name: "Nix Flake Update"
2023-10-03 14:27:00 +02:00
run: |
2023-10-03 14:49:47 +02:00
echo "Running Nix Flake Update"
cd /workspace/albert/nix
2023-10-04 10:42:05 +02:00
nix --extra-experimental-features "nix-command flakes" flake update
2023-10-03 14:49:47 +02:00
echo "Git Diff:"
git diff
2023-10-04 10:42:05 +02:00
- name: "Commit and Upload"
run: |
2023-10-04 11:32:38 +02:00
git commit -am "[ACTIONS] Flake Update"
2023-10-04 10:42:05 +02:00
git push
2023-10-04 02:42:45 +02:00
- if: success()
run: |
2023-10-04 11:17:48 +02:00
echo "Success!"
2023-10-03 07:20:25 +02:00
- if: always()
2023-10-03 07:46:16 +02:00
run: rm -rf /.cache
- if: always()
run: rm -rf ${{ github.worksspace }}