diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index f29835e..3f4323c 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -13,13 +13,29 @@ jobs: tag: - openjdk-11-maven-3.8.6 steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - name: Clone git repo + uses: actions/checkout@v3 - - run: apt update; apt install -y buildah - - run: make ${{matrix.tag}} - - run: make ${{matrix.tag}} PUSH=y - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + - name: List modified files + uses: tj-actions/changed-files@v45 + with: + files: | + ${{matrix.tag}}/** + id: changed + + - name: Install Buildah + run: apt update; apt install -y buildah + if: steps.changed.outputs.any_changed == 'true' + + - name: Build OCI image + run: make ${{matrix.tag}} + if: steps.changed.outputs.any_changed == 'true' + + - name: Push image to OCI registry + run: make ${{matrix.tag}} PUSH=y + if: >- + steps.changed.outputs.any_changed == 'true' + && github.ref == 'refs/heads/master' + && github.event_name == 'push' env: REGISTRY_PASSWORD: ${secrets.REGISTRY_PASSWORD}