Update Boluo Images #16
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
name: Update Boluo Images | |
on: | |
workflow_run: | |
workflows: ['Check'] | |
types: [completed] | |
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 |