diff --git a/.github/workflows/build-images-base.yaml b/.github/workflows/build-images-base.yaml index 79ea19bf..26726c4e 100644 --- a/.github/workflows/build-images-base.yaml +++ b/.github/workflows/build-images-base.yaml @@ -118,7 +118,6 @@ jobs: REGISTRY=${{ env.IMG_REGISTRY_HOST }} \ ORG=${{ env.IMG_REGISTRY_ORG }} \ VERSION=${{ env.VERSION }} \ - IMAGE_TAG=${{ inputs.operatorTag }} \ LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \ REPLACES_VERSION=${{ inputs.replacesVersion }} \ CHANNELS=${{ inputs.channels }} diff --git a/.github/workflows/build-images-branches-2.yaml b/.github/workflows/build-images-branches-2.yaml new file mode 100644 index 00000000..adc26cae --- /dev/null +++ b/.github/workflows/build-images-branches-2.yaml @@ -0,0 +1,36 @@ +name: Schedule build with latest image SHA versions + +on: + push: + branches: ['*'] + +jobs: + release-date: + name: GetDate + runs-on: ubuntu-latest + outputs: + date: ${{ steps.date.outputs.date }} + steps: + - id: date + run: echo "RELEASE_DATE=nightly-$(date +'%d-%m-%Y')" >> $GITHUB_OUTPUT + limitador-latest-revision: + name: Get the latest git commit from limitador in the default branch + runs-on: ubuntu-latest + steps: + - id: lastcommit + uses: nmbgeek/github-action-get-latest-commit@v0.1.0 + with: + repository: Kuadrant/limitador + # avoid the action failing due to API rate limiting + token: ${{ secrets.GITHUB_TOKEN }} + - name: Print Limitador's last commit revision + run: echo "${{ steps.lastcommit.outputs.hash }}" + workflow-build: + needs: [release-date, limitador-latest-revision] + name: Calls build-images-base workflow + uses: ./.github/workflows/build-images-base.yaml + secrets: inherit + with: + operatorVersion: ${{ github.sha }} + operatorTag: ${{ needs.release-date.outputs.RELEASE_DATE }} + limitadorVersion: ${{ needs.limitador-latest-revision.steps.lastcommit.outpus.hash }} diff --git a/.github/workflows/build-images-branches.yaml b/.github/workflows/build-images-branches.yaml index 133f1f22..6f3aeea9 100644 --- a/.github/workflows/build-images-branches.yaml +++ b/.github/workflows/build-images-branches.yaml @@ -1,8 +1,9 @@ -name: Build images for dev branches +name: Build images for branches on: push: branches: ['*'] + workflow_dispatch: {} jobs: workflow-build: @@ -13,3 +14,4 @@ jobs: with: operatorVersion: ${{ github.ref_name }} operatorTag: ${{ github.ref_name }} + limitadorVersion: latest diff --git a/.github/workflows/build-images-main.yaml b/.github/workflows/build-images-main.yaml deleted file mode 100644 index 587e8a84..00000000 --- a/.github/workflows/build-images-main.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Build images for main branch - -on: - push: - branches: ['main'] - -jobs: - workflow-build: - name: Calls build-images-base workflow - uses: ./.github/workflows/build-images-base.yaml - secrets: inherit diff --git a/.github/workflows/build-images-scheduled.yaml b/.github/workflows/build-images-scheduled.yaml index e58df201..3e982f5c 100644 --- a/.github/workflows/build-images-scheduled.yaml +++ b/.github/workflows/build-images-scheduled.yaml @@ -3,13 +3,35 @@ name: Schedule build with latest image SHA versions on: schedule: - cron: '0 0 * * 0' + workflow_dispatch: {} jobs: + release-date: + name: GetDate + runs-on: ubuntu-latest + outputs: + date: ${{ steps.date.outputs.date }} + steps: + - id: date + run: echo "RELEASE_DATE=nightly-$(date +'%d-%m-%Y')" >> $GITHUB_OUTPUT + limitador-latest-revision: + name: Get the latest git commit from limitador in the default branch + runs-on: ubuntu-latest + steps: + - id: lastcommit + uses: nmbgeek/github-action-get-latest-commit@v0.1.0 + with: + repository: Kuadrant/limitador + # avoid the action failing due to API rate limiting + token: ${{ secrets.GITHUB_TOKEN }} + - name: Print Limitador's last commit revision + run: echo "${{ steps.lastcommit.outputs.hash }}" workflow-build: + needs: [release-date, limitador-latest-revision] name: Calls build-images-base workflow uses: ./.github/workflows/build-images-base.yaml secrets: inherit with: operatorVersion: ${{ github.sha }} - operatorTag: ${{ github.sha }} - limitadorVersion: ${{ vars.LIMITADOR_SHA }} + operatorTag: ${{ needs.release-date.outputs.RELEASE_DATE }} + limitadorVersion: ${{ needs.limitador-latest-revision.steps.lastcommit.outpus.hash }}