nix/.forgejo/workflows/update-flake-lock.yml
albert 96e6da10a4
Some checks failed
update-flake-lock / update-flake-lock (push) Failing after 7m36s
Update workflows
2024-06-30 09:24:49 +09:00

71 lines
2.3 KiB
YAML

name: update-flake-lock
run-name: ${{ github.actor }} - update-flake-lock
on:
push:
schedule:
- cron: '0 0 * * 0'
# “At 00:00 Sunday."
jobs:
update-flake-lock:
runs-on: ubuntu
container:
image: ubuntu:24.04
steps:
- name: "Setup Runner"
run: |
apt update -y
apt install git nodejs nix-bin qemu-utils qemu-system-arm qemu-user-binfmt -y
git config --global user.email "${{github.actor}}"
git config --global user.name "Forgejo Runner"
echo "100.64.0.14 gotify.sysctl.io" >> /etc/hosts
- uses: actions/checkout@v3
- name: "Directory Structure"
run: |
ls ${{ github.workspace }}/*
- name: "Git Info"
run: |
git -C ${{ github.workspace }} status
git -C ${{ github.workspace }} log
git -C ${{ github.workspace }} diff
- name: "Runner: Node Info"
run: |
id
uname -a
hostname
cat /etc/os-release
- name: "Nix Version"
run: |
nix --version
- name: "Nix Flake Update"
run: |
echo "Running Nix Flake Update"
cd /workspace/albert/nix
git pull
nix --extra-experimental-features "nix-command flakes" flake update
echo "Git Diff:"
git diff
- name: "Nix Flake Check"
run: |
echo "Running Nix Flake Check"
cd /workspace/albert/nix
nix --extra-experimental-features "nix-command flakes" flake check
- if: success()
run: |
git commit -am "[ACTIONS] Flake Update (`date +%Y-%m-%d`)"
git push
- if: success()
uses: https://git.sysctl.io/actions/gotify-action@master
with:
gotify_api_base: '${{ secrets.GOTIFY_URL }}'
gotify_app_token: '${{ secrets.GOTIFY_TOKEN }}'
notification_title: '[ ${{ github.repository }}: ${{ github.workflow }} ] NixOS Flake Updated'
notification_message: 'Build completed successfully.'
- if: failure()
uses: https://git.sysctl.io/actions/gotify-action@master
with:
gotify_api_base: '${{ secrets.GOTIFY_URL }}'
gotify_app_token: '${{ secrets.GOTIFY_TOKEN }}'
notification_title: '[ ${{ github.repository }}: ${{ github.workflow }} ] Build Failed'
notification_message: 'Your build has failed. Check Forgejo.'
name: "Send Notification"