Skip to content

Build & publish docker images (branch) #11

Build & publish docker images (branch)

Build & publish docker images (branch) #11

name: Build & publish docker images (branch)
on:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: wydler/parsedmarc-elasticsearch
dockerfile: ./elasticsearch/docker/Dockerfile
- image: wydler/parsedmarc-geoipupdate
dockerfile: ./geoipupdate/docker/Dockerfile
- image: wydler/parsedmarc-kibana
dockerfile: ./kibana/docker/Dockerfile
- image: wydler/parsedmarc-nginx
dockerfile: ./nginx/docker/Dockerfile
- image: wydler/parsedmarc-app
dockerfile: ./parsedmarc/docker/Dockerfile
- image: wydler/parsedmarc-utils
dockerfile: ./utils/docker/Dockerfile
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache