mirror of
https://github.com/mkuf/prind.git
synced 2025-11-02 11:26:29 +01:00
ci: force image build if source changes
This commit is contained in:
59
.github/workflows/image-build-and-publish-push.yaml
vendored
Normal file
59
.github/workflows/image-build-and-publish-push.yaml
vendored
Normal file
@@ -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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: 'Build and Publish Images'
|
name: 'Build and Publish Images on a Schedule'
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
<!--
|
<!--
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
* ci: force image build if source changes in main
|
||||||
### Fixed
|
### Fixed
|
||||||
### Changed
|
### Changed
|
||||||
### Removed
|
### Removed
|
||||||
|
|||||||
Reference in New Issue
Block a user