Skip to content

Commit

Permalink
chore(ci): moved manifest step to its own reusable workflow.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Dec 15, 2023
1 parent 1b8f768 commit 65db5b7
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 28 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
needs: build-test-arm64
with:
arch: arm64
secrets: inherit
secrets: inherit

images:
uses: ./.github/workflows/reusable_manifest_images.yml
needs: [push-images,push-images-arm64]
secrets: inherit


10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ jobs:
arch: arm64
tag: ${{ github.ref_name }}
is_latest: true
secrets: inherit
secrets: inherit

images:
uses: ./.github/workflows/reusable_manifest_images.yml
needs: [push-images,push-images-arm64]
with:
tag: ${{ github.ref_name }}
is_latest: true
secrets: inherit

release:
needs: [push-images,push-images-arm64]
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/reusable_build_push_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,3 @@ jobs:
- name: Push latest images if needed
if: inputs.is_latest
run: make push/latest

images:
runs-on: ubuntu-latest
needs: build-images
env:
GIT_BRANCH: ${{ inputs.branch }}
GIT_TAG: ${{ inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_SECRET }}

- name: Build and Push manifest to registry
run: make manifest/all

- name: Push latest manifest if needed
if: inputs.is_latest
run: make manifest/latest
45 changes: 45 additions & 0 deletions .github/workflows/reusable_manifest_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is a reusable workflow used by master and release CI
on:
workflow_call:
inputs:
branch:
description: name of the branch
required: false
type: string
default: 'master'
tag:
description: The tag to use (e.g. "master" or "0.35.0")
required: false
type: string
default: ''
is_latest:
description: Update the latest tag with the new image
required: false
type: boolean
default: false

jobs:
push-manifest:
runs-on: ubuntu-latest
env:
GIT_BRANCH: ${{ inputs.branch }}
GIT_TAG: ${{ inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_SECRET }}

- name: Build and Push manifest to registry
run: make manifest/all

- name: Push latest manifest if needed
if: inputs.is_latest
run: make manifest/latest

0 comments on commit 65db5b7

Please sign in to comment.