diff --git a/.github/workflows/image-build-and-publish-push.yaml b/.github/workflows/image-build-and-publish-push.yaml new file mode 100644 index 0000000..43610a7 --- /dev/null +++ b/.github/workflows/image-build-and-publish-push.yaml @@ -0,0 +1,59 @@ +name: 'Build and Publish Images on Push' + +on: + push: + branches: + - main + paths: + - docker/** + +jobs: + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + apps: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + klipper: + - docker/klipper/** + klipperscreen: + - docker/klipperscreen/** + moonraker: + - docker/moonraker/** + ustreamer: + - docker/ustreamer/** + build: + needs: changes + if: ${{ needs.changes.outputs.apps != '' && toJson(fromJson(needs.changes.outputs.apps)) != '[]' }} + strategy: + fail-fast: false + matrix: + app: ${{ fromJSON(needs.changes.outputs.apps) }} + runs-on: ubuntu-latest + steps: + - name: "[prind] checkout" + uses: actions/checkout@v4 + - name: "[prind] set up build environment" + uses: ./.github/actions/image-build-common + - name: "[docker] login" + uses: docker/login-action@v3.3.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: "[prind] build" + run: | + python3 scripts/build/build.py ${{ matrix.app }} \ + --backfill 0 \ + --platform linux/amd64 \ + --platform linux/arm/v6 \ + --platform linux/arm/v7 \ + --platform linux/arm64/v8 \ + --registry docker.io/${{ secrets.DOCKERHUB_USERNAME }} \ + --push \ + --force diff --git a/.github/workflows/image-build-and-publish.yaml b/.github/workflows/image-build-and-publish-schedule.yaml similarity index 95% rename from .github/workflows/image-build-and-publish.yaml rename to .github/workflows/image-build-and-publish-schedule.yaml index 286f6ff..574ad26 100644 --- a/.github/workflows/image-build-and-publish.yaml +++ b/.github/workflows/image-build-and-publish-schedule.yaml @@ -1,4 +1,4 @@ -name: 'Build and Publish Images' +name: 'Build and Publish Images on a Schedule' on: workflow_dispatch: schedule: diff --git a/CHANGELOG.md b/CHANGELOG.md index fd6322b..63d1363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).