Skip to content

Commit

Permalink
Refactor container.yml (#838)
Browse files Browse the repository at this point in the history
* Refactor container.yml

Refactor 'set IS_VERSION_TAG' into determine-tags-action composite action

* Fix: determine-tags-action by adding shell attribute to steps

* Refactor/Fix: Move docker setup to seperate composite action

* Fix: setup-docker-action by adding secrets as inputs

* Update: Merge container.yml and push.yml

* Remove deprecated Actions and Workflows

* Update: Remove stable, oldstable branches from CI trigger

* Trigger CI

* Change: Add base-image-label for oldstable and testing

---------

Co-authored-by: Robert Schardt <[email protected]>
  • Loading branch information
robert-schardt and Robert Schardt authored Sep 27, 2024
1 parent 7a2e624 commit 86eb21e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 187 deletions.
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

0 comments on commit 86eb21e

Please sign in to comment.