From dd7f3f7579c6b7e99527ae1028839dde97b1d148 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 14 Jul 2023 21:08:18 +0800 Subject: [PATCH] ci: rename and update 'update' workflow --- .github/workflows/automate-update.yml | 35 --------------------------- .github/workflows/update.yml | 28 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/automate-update.yml create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/automate-update.yml b/.github/workflows/automate-update.yml deleted file mode 100644 index c7b92cea..00000000 --- a/.github/workflows/automate-update.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "Automated flake inputs update" -on: - schedule: - # Every week on Friday. - - cron: '0 0 * * 5' -env: - NIXPKGS_ALLOW_INSECURE: "1" - NIXPKGS_ALLOW_BROKEN: "1" - NIXPKGS_ALLOW_UNFREE: "1" - - # GitHub bot - GIT_AUTHOR_NAME: "github-actions[bot]" - GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com" - GIT_COMMITTER_NAME: "github-actions[bot]" - GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com" -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: DeterminateSystems/magic-nix-cache-action@v2 - - uses: DeterminateSystems/nix-installer-action@v4 - - name: Update flake inputs - run: | - nix flake update --commit-lock-file \ - --commit-lockfile-summary 'flake.lock: update inputs' - - name: Build custom packages - run: nix build --impure --file ./pkgs - - name: Build NixOS configurations - run: nix build --impure .#nixosConfigurations.ni.config.system.build.toplevel - - name: Push updates to remote - run: | - git remote remove origin - git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/foo-dogsquared/nixos-config.git - git push --set-upstream origin master --tags diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..0e326691 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,28 @@ +name: "Update flake inputs" +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 5' # Every week on Friday. +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: DeterminateSystems/nix-installer-action@v4 + - name: Update flake inputs + run: nix flake update --commit-lock-file --commit-lockfile-summary "flake.lock: update inputs" + env: + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + - name: Build custom packages + run: nix build --impure --file ./pkgs + - name: Build NixOS configurations + run: nix build --impure .#images.{ni,plover,bootstrap} + - name: Push changes to remote + run: | + git remote remove origin + git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git + git push --set-upstream origin master