From 1abc06f58c593ba3fc39d81fd7d6e74adee21bd1 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 21 Mar 2025 21:46:05 +0100 Subject: [PATCH] Add gitea action for updating flake --- .gitea/workflows/update-flake.yaml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitea/workflows/update-flake.yaml diff --git a/.gitea/workflows/update-flake.yaml b/.gitea/workflows/update-flake.yaml new file mode 100644 index 0000000..8bd5b59 --- /dev/null +++ b/.gitea/workflows/update-flake.yaml @@ -0,0 +1,41 @@ +name: Update Nix Flake + +on: + schedule: + - cron: "30 0 * * *" # daily run + workflow_dispatch: {} + +jobs: + update-flake: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: "${{ secrets.GH_TOKEN }}" + fetch-depth: 0 + ref: flake-updates + + - name: Fetch latest changes and reset branch + run: | + git fetch origin master + git reset --hard origin/master + + - name: Set up Nix + uses: cachix/install-nix-action@v31 + + - name: Update Flake + run: nix flake update + + - name: Commit and push changes + shell: bash + run: | + git config user.name "Gitea Actions" + git config user.email "actions@gitea.local" + git add flake.lock + if git diff --cached --quiet; then + echo "No changes to commit." + else + git commit -m "Update flake.lock $(date -I)" + git push origin flake-updates + fi