Skip to content

Commit

Permalink
bundle image nightly build with limitador lastcommit
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
  • Loading branch information
eguzki committed Sep 4, 2024
1 parent 8d7e9ed commit f3d7c94
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-images-branches-2.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
4 changes: 3 additions & 1 deletion .github/workflows/build-images-branches.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Build images for dev branches
name: Build images for branches

on:
push:
branches: ['*']
workflow_dispatch: {}

jobs:
workflow-build:
Expand All @@ -13,3 +14,4 @@ jobs:
with:
operatorVersion: ${{ github.ref_name }}
operatorTag: ${{ github.ref_name }}
limitadorVersion: latest
11 changes: 0 additions & 11 deletions .github/workflows/build-images-main.yaml

This file was deleted.

26 changes: 24 additions & 2 deletions .github/workflows/build-images-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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 }}

0 comments on commit f3d7c94

Please sign in to comment.