Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: product compose file udates from 2nd gen services #140

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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