Skip to content

Refactor repo for containerized deploys, Helm chart, and release auto… #3

Refactor repo for containerized deploys, Helm chart, and release auto…

Refactor repo for containerized deploys, Helm chart, and release auto… #3

Workflow file for this run

name: Build and publish Docker images
on:
push:
tags:
- 'v*'
permissions:
contents: read
packages: write
jobs:
release-approval:
runs-on: ubuntu-24.04
environment: release
steps:
- name: Release approved
run: echo "Environment 'release' approved; publishing container images."
build-and-push:
needs: release-approval
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- image: bigipreport-frontend
context: frontend
- image: bigipreport-data-collector
context: data-collector
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
tags: |
# Git tag is v* (keep that). Publish both bare semver and v-prefixed image tags for pulls either way.
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image }}
cache-to: type=gha,mode=max,scope=${{ matrix.image }}