Skip to content

Commit

Permalink
feat(ci): automate Docker image builds in CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
c0deplayer committed Oct 29, 2024
1 parent 2434ad2 commit fa82cdf
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Docker Images
on:
push:
branches:
- 'main'
schedule:
- cron: '30 16 * * *'

jobs:
push_to_docker_hub:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: c0deplayer/dc-ocr
dockerfile: ./Dockerfile.ocr
- image: c0deplayer/dc-process
dockerfile: ./Dockerfile.process

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ matrix.image }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit fa82cdf

Please sign in to comment.