Skip to content

Fix CodeQL alerts and add release Makefile (v1.3.1) (#29) #35

Fix CodeQL alerts and add release Makefile (v1.3.1) (#29)

Fix CodeQL alerts and add release Makefile (v1.3.1) (#29) #35

name: Build and publish Docker image
on:
push:
branches: [main]
tags: ["v*.*.*"]
schedule:
# Weekly on Monday at 04:00 UTC — picks up base image security patches
- cron: "0 4 * * 1"
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to Docker Hardened Images
uses: docker/login-action@v4
with:
registry: dhi.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags and labels)
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/${{ github.repository }}
${{ secrets.DOCKERHUB_USERNAME }}/py-conf-sync
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=,format=short
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}