fix(flux): switch pve-nut image policy to numerical run-number ordering #4
This file contains hidden or 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: Build PVE NUT Deployer | |
| on: | |
| push: | |
| paths: | |
| - 'scripts/pve-nut/**' | |
| - '.github/workflows/build-pve-nut.yaml' | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository_owner }}/pve-nut | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set short SHA | |
| id: vars | |
| run: echo "sha_short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: scripts/pve-nut | |
| push: true | |
| # Tag format: <run_number>-<short_sha>. The run_number prefix lets the | |
| # Flux ImagePolicy sort numerically (newest build wins) — earlier we | |
| # used bare 7-char SHAs with alphabetical-desc, which is unsound for | |
| # git SHAs (e.g. 'e6e2d9b' beat '9d5fdfe' purely on first hex char, | |
| # making the OLDEST commit "latest"). Matches the pattern used by | |
| # frigate-health-checker. | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }}-${{ steps.vars.outputs.sha_short }} |