-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a new workflow to update the "boluo-images" repository
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |