Skip to content

Commit

Permalink
Add: product compose file udates from 2nd gen services (#140)
Browse files Browse the repository at this point in the history
* Add: product compose file udates from 2nd gen services

* Update .github/workflows/container-build-push-2nd-gen.yml

Co-authored-by: Jaspar Stach <[email protected]>

---------

Co-authored-by: Jaspar Stach <[email protected]>
  • Loading branch information
pascalholthaus and y0urself authored Nov 21, 2024
1 parent d505ffc commit 9509aaf
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/container-build-push-2nd-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
ref-name:
description: "The ref to build a container image from. For example a tag v23.0.0."
type: string
service:
description: "The image related compose service name."
type: string
build-context:
description: "Path to image build context. Default is ."
default: .
Expand Down Expand Up @@ -190,6 +193,8 @@ jobs:
needs:
- build-amd64
- build-arm64
outputs:
digest: ${{ steps.manifest.outputs.digest }}
steps:
- name: Get branch
id: branch
Expand Down Expand Up @@ -230,6 +235,7 @@ jobs:
type=raw,value=testing-edge,enable=${{ (steps.branch.outputs.branch == 'main') && (inputs.base-image-label == 'testing') }}
- name: Create multi arch manifest
id: manifest
uses: greenbone/actions/container-multi-arch-manifest@v3
with:
cosign-key: ${{ secrets.COSIGN_KEY_OPENSIGHT }}
Expand All @@ -247,31 +253,26 @@ jobs:
registry-username: ${{ secrets.GREENBONE_REGISTRY_USER }}
registry-password: ${{ secrets.GREENBONE_REGISTRY_TOKEN }}

test-pull-arm64:
if: ${{ (needs.build-arm64.outputs.is-latest-tag == 'true') && (inputs.base-image-label == 'stable') && (github.event_name != 'pull_request') }}
name: Test pulling the image on arm64
needs: [build-arm64, create-multi-arch-manifest]
runs-on: self-hosted-generic-arm64
steps:
- name: Pull
run: docker pull registry.community.greenbone.net/${{ inputs.image-url }}:latest

test-pull-amd64:
if: ${{ (needs.build-amd64.outputs.is-latest-tag == 'true') && (inputs.base-image-label == 'stable') && (github.event_name != 'pull_request') }}
name: Test pulling the image on amd64
needs: [build-amd64, create-multi-arch-manifest]
runs-on: self-hosted-generic
# This job updates the Compose files for our products when a service name is provided by the workflow caller.
building-product-compose:
if: startsWith(github.ref, 'refs/tags/v') && inputs.service
needs:
- create-multi-arch-manifest
runs-on: "ubuntu-latest"
steps:
- name: Pull
run: docker pull registry.community.greenbone.net/${{ inputs.image-url }}:latest
- name: Trigger product compose upgrade
uses: greenbone/actions/trigger-workflow@v3
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: "greenbone/automatix"
workflow: "push.yml"
inputs: '{"service": "${{ inputs.service }}", "image-url": "${{ inputs.image-url }}", "digest": "${{ needs.create-multi-arch-manifest.outputs.digest }}", "version": "${{ github.ref_name }}"}'

notify:
needs:
- build-amd64
- build-arm64
- create-multi-arch-manifest
- test-pull-amd64
- test-pull-arm64
if: ${{ !cancelled() && startsWith(inputs.notify, 'true') && github.event_name != 'pull_request' }}
uses: greenbone/workflows/.github/workflows/notify-mattermost-2nd-gen.yml@main
with:
Expand Down

0 comments on commit 9509aaf

Please sign in to comment.