Skip to content

Commit

Permalink
chore: add a new workflow to update the "boluo-images" repository
Browse files Browse the repository at this point in the history
  • Loading branch information
uonr committed Aug 2, 2024
1 parent ffe3778 commit 316abd6
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/update-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Boluo Images

on:
push:
branches:
- production

jobs:
update-images:
runs-on: ubuntu-latest

steps:
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.UPDATE_IMAGES_KEY }}

- name: Checkout repository
uses: actions/checkout@v4
with:
repository: 'mythal/boluo-images'
ssh-key: ${{ secrets.UPDATE_IMAGES_KEY }}

- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Update the flake
run: |
nix flake lock --update-input boluo-production
- name: Commit and push changes
run: |
# Exit if there are no changes
git diff --exit-code && exit 0
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Automated update the flake via GitHub Actions"
git push origin master

0 comments on commit 316abd6

Please sign in to comment.