Skip to content

Build + Push Docker images #3

Build + Push Docker images

Build + Push Docker images #3

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: ./Dockerfile
name: psql-dump
context: ./
python-version: 3.11
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