Skip to content

Commit

Permalink
Add GitHub workflow to update flake inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
koenw committed Nov 25, 2024
1 parent e4be098 commit e289b80
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
publish-release-binaries:
name: Publish release
Expand Down Expand Up @@ -33,7 +37,7 @@ jobs:
run: nix --extra-experimental-features nix-command --extra-experimental-features flakes build '.#static'

- name: Copy release binaries to output directory
run: cp result/bin/syslog-clint result/bin/syslog-server output
run: cp result/bin/syslog-client result/bin/syslog-server output

- name: Build release docker image
run: nix --extra-experimental-features nix-command --extra-experimental-features flakes build '.#docker'
Expand All @@ -42,9 +46,9 @@ jobs:
run: cp result output/docker-image

- run: docker load <result
- run: docker tag syslog-utils:latest ghcr.io/${IMAGE_NAME}:latest
- run: docker tag syslog-utils:latest ghcr.io/${IMAGE_NAME}:${{ github.ref_name }}
- run: docker push ghcr.io/${IMAGE_NAME}:${{ github.ref_name }}
- run: docker tag syslog-utils:latest ${{ env.REGISTRY }}/${IMAGE_NAME}:latest
- run: docker tag syslog-utils:latest ${{ env.REGISTRY }}/${IMAGE_NAME}:${{ github.ref_name }}
- run: docker push ${{ env.REGISTRY }}/${IMAGE_NAME}:${{ github.ref_name }}

- name: Create the release
uses: softprops/action-gh-release@v2
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/update-flake-inputs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update flake inputs

on:
schedule:
- cron: '4 4 * * 1'

jobs:
nix-flake-update:
name: Update flake inputs
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix --extra-experimental-features nix-command --extra-experimental-features flakes build '.#static'

- run: nix flake update --commit-lock-file

- uses: peter-evans/create-pull-request@v3
with:
branch: bot/update
delete-branch: true
title: Update flake inputs

0 comments on commit e289b80

Please sign in to comment.