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

54 lines
1.5 KiB
YAML
Raw Normal View History

2023-10-03 21:49:47 +09:00
name: update-flake-lock
run-name: ${{ github.actor }} - update-flake-lock
2023-11-30 15:01:52 +09:00
on:
2023-11-30 15:27:47 +09:00
schedule:
- cron: '0 0 * * 6'
# “At 00:00 on Saturday.”
2023-10-02 19:08:16 +09:00
jobs:
2023-10-03 21:49:47 +09:00
update-flake-lock:
2023-10-02 19:08:16 +09:00
runs-on: docker
2023-10-03 20:47:28 +09:00
container:
2023-10-03 21:07:16 +09:00
image: alpine:edge
2023-10-02 19:08:16 +09:00
steps:
2023-10-03 20:53:46 +09:00
- name: "Setup Runner"
run: |
apk update
2023-11-30 15:25:45 +09:00
apk add git nodejs nix --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
2023-10-04 09:51:24 +09:00
git config --global user.email "${{github.actor}}"
git config --global user.name "Albert J. Copeland"
2023-11-30 15:20:28 +09:00
- uses: actions/checkout@v3
2023-10-03 14:11:21 +09:00
- name: "Directory Structure"
2023-10-03 11:47:57 +09:00
run: |
2023-10-03 12:11:56 +09:00
ls ${{ github.workspace }}/*
2023-11-30 15:20:28 +09:00
- name: "Git Info"
run: |
git -C ${{ github.workspace }} status
git -C ${{ github.workspace }} log
git -C ${{ github.workspace }} diff
2023-10-03 19:42:17 +09:00
- name: "Runner: Node Info"
run: |
id
uname -a
hostname
2023-10-03 21:00:28 +09:00
cat /etc/os-release
2023-10-03 21:10:47 +09:00
- name: "Nix Version"
run: |
nix --version
2023-10-04 10:29:20 +09:00
- name: "Nix Flake Update"
2023-10-03 21:27:00 +09:00
run: |
2023-10-03 21:49:47 +09:00
echo "Running Nix Flake Update"
cd /workspace/albert/nix
2023-10-04 17:42:05 +09:00
nix --extra-experimental-features "nix-command flakes" flake update
2023-10-03 21:49:47 +09:00
echo "Git Diff:"
git diff
2023-10-04 17:42:05 +09:00
- name: "Commit and Upload"
run: |
2023-10-04 18:32:38 +09:00
git commit -am "[ACTIONS] Flake Update"
2023-10-04 17:42:05 +09:00
git push
2023-10-04 09:42:45 +09:00
- if: success()
run: |
2023-10-04 18:17:48 +09:00
echo "Success!"
2023-10-03 14:20:25 +09:00
- if: always()
2023-10-03 14:46:16 +09:00
run: rm -rf /.cache
- if: always()
run: rm -rf ${{ github.worksspace }}