diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index d2661ff..6dfb052 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -11,6 +11,10 @@ on: branch: type: string required: true + publish: + type: boolean + default: false + required: false jobs: build-image: @@ -35,7 +39,7 @@ jobs: ${{ env.IMAGE_NAME }}/Containerfile - name: Log in to ghcr.io - if: github.ref == 'refs/heads/main' + if: inputs.publish == true uses: redhat-actions/podman-login@v1 with: registry: ${{ env.REGISTRY }} @@ -43,7 +47,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push image to ghcr.io - if: github.ref == 'refs/heads/main' + if: inputs.publish == true uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image.outputs.image }} diff --git a/.github/workflows/fedora-ci.yml b/.github/workflows/fedora-ci.yml index 7eee7a3..e111973 100644 --- a/.github/workflows/fedora-ci.yml +++ b/.github/workflows/fedora-ci.yml @@ -8,5 +8,6 @@ jobs: uses: ./.github/workflows/build-image.yml with: image_name: "fedora-ci" - tags: unstable ${{ github.sha }} + tags: unstable + publish: ${{ github.ref == 'refs/heads/main' }} branch: main diff --git a/.github/workflows/nightly-update.yml b/.github/workflows/nightly-update.yml new file mode 100644 index 0000000..92793ed --- /dev/null +++ b/.github/workflows/nightly-update.yml @@ -0,0 +1,20 @@ +name: Update all images +on: + schedule: + # Every day at 2:49 AM + - cron: "49 2 * * *" + +jobs: + fedora-ci-40: + uses: ./.github/workflows/build-image.yml + with: + image_name: "fedora-ci" + tags: "40" + branch: f40 + + fedora-ci-unstable: + uses: ./.github/workflows/build-image.yml + with: + image_name: "fedora-ci" + tags: unstable + branch: main