Skip to content

Build + Push Docker images #38

Build + Push Docker images

Build + Push Docker images #38

Workflow file for this run

name: Build + Push Docker images
run-name: Build + Push Docker images
on:
- push
- workflow_dispatch
jobs:
build-and-push:
name: Build and Push ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./generic/detector/Dockerfile
name: anomalydetector
context: ./generic/detector
python-version: 3.8
- dockerfile: ./bgp/producers/Dockerfile
name: bgp
context: ./bgp/producers
python-version: 3.8
- dockerfile: ./peeringdb/producers/Dockerfile
name: peeringdb
context: ./peeringdb/producers
python-version: 3.8
- dockerfile: ./atlas/producers/Dockerfile.traceroute
name: traceroute
context: ./atlas/producers
python-version: 3.8
- dockerfile: ./atlas/producers/Dockerfile.measurements
name: measurement_ids
context: ./atlas/producers
python-version: 3.8
- dockerfile: ./psql/consumers/Dockerfile
name: psql_consumers
context: ./psql/consumers
python-version: 3.8
steps:
- uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login into DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
logout: true
- name: Build + Push ${{ matrix.name }} image to DockerHub
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
build-args:
PYTHON_VERSION=${{ matrix.python-version }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ matrix.python-version }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest