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

Refactor container.yml #838

Merged
merged 10 commits into from
Sep 27, 2024
184 changes: 0 additions & 184 deletions .github/workflows/container.yml

This file was deleted.

78 changes: 75 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push to Greenbone Registry
name: Build & Push to Greenbone Registry

on:
push:
Expand All @@ -14,8 +14,8 @@ on:
required: true

jobs:
build:
name: Build and Push to Greenbone Registry
build-push-debian-stable-container:
name: Build and Push debian:stable to Greenbone Registry
uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main
with:
image-url: community/gvm-libs
Expand All @@ -24,3 +24,75 @@ jobs:
org.opencontainers.image.base.name=debian:stable-slim
ref-name: ${{ inputs.ref-name }}
secrets: inherit

build-push-debian-oldstable-container:
name: Build and Push debian:oldstable to Greenbone Registry
uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main
with:
build-docker-file: .docker/prod-oldstable.Dockerfile
image-url: community/gvm-libs
image-labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=debian:stable-slim
base-image-label: "oldstable"
ref-name: ${{ inputs.ref-name }}
secrets: inherit

build-push-debian-testing-container:
name: Build and Push debian:testing to Greenbone Registry
uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main
with:
build-docker-file: .docker/prod-testing.Dockerfile
image-url: community/gvm-li
image-labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=debian:stable-slim
base-image-label: "testing"
ref-name: ${{ inputs.ref-name }}
secrets: inherit

# triggers projects that work with stable branches on a new stable tag
trigger-stable-projects:
needs: build-push-debian-stable-container
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
name: Trigger update container images in related projects for new tags
strategy:
fail-fast: false
matrix:
repository: ["greenbone/gvmd", "greenbone/gsad"]
runs-on: ubuntu-latest
steps:
- name: Trigger ${{ matrix.repository }} build container image build
uses: greenbone/actions/trigger-workflow@v3
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: ${{ matrix.repository }}
workflow: build-container.yml
ref: main
- name: Trigger ${{ matrix.repository }} container image build
uses: greenbone/actions/trigger-workflow@v3
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: ${{ matrix.repository }}
workflow: container.yml
ref: main

trigger-related-projects:
needs: build-push-debian-stable-container
if: github.event_name != 'pull_request'
name: Trigger update container images in related projects
strategy:
fail-fast: false
matrix:
repository:
- "greenbone/openvas-scanner"
- "greenbone/boreas"
runs-on: ubuntu-latest
steps:
- name: Trigger main ${{ matrix.repository }} container image build
uses: greenbone/actions/trigger-workflow@v3
with:
token: ${{ secrets.GREENBONE_BOT_TOKEN }}
repository: ${{ matrix.repository }}
workflow: ${{ matrix.repository == 'greenbone/openvas-scanner' && 'control.yml' || 'container.yml' }}
ref: main