-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (37 loc) · 1.33 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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