Skip to content

Docker Image CI

Docker Image CI #20

Workflow file for this run

name: Docker Image CI
on:
create:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_NAMESPACE: ${{ secrets.DOCKER_NAMESPACE }}
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
jobs:
push_to_registry:
if: ${{ startsWith(github.ref, 'refs/tags') }}
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: client_meta
uses: docker/[email protected]
with:
images: ${{ env.DOCKER_NAMESPACE }}/${{ env.DOCKER_REPOSITORY }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.client_meta.outputs.tags }}