Skip to content

Publish Docker Images #34

Publish Docker Images

Publish Docker Images #34

Workflow file for this run

name: Publish Docker Images
# This should run only after the tests from the CI pipeline have passed.
# On a rare ocassion contributors can trigger this manually, and it should also
# run after a release has been published.
on:
workflow_run:
workflows: ["continuous integration (ci)"]
types:
- completed
push:
branches:
- main
- dev
workflow_dispatch:
release:
types: [published]
jobs:
push_to_registries:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract Metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: |
kaszanas/datasetpreparator
- name: Build and Push Docker images
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}