Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Refactor Docker image building workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
caic99 committed Feb 22, 2024
1 parent 5421a3b commit 9fdd36d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 68 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/ci_docker.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Uni-Dock/Tools Build Image Workflow
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "*"

jobs:
build_and_push_docker_image:
runs-on: ubuntu-latest
if: github.repository_owner == 'dptech-corp'
strategy:
matrix:
target: [unidock, unidock_tools]
max-parallel: 1 # Ensures unidock_tools is built after unidock

steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: dptechnology/${{ matrix.target }}
tags: |
type=sha
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: dptechnology
password: ${{ secrets.DOCKERHUB_PAT }}

- name: build and push container
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile
context: "{{defaultContext}}:${{ matrix.target }}"
push: true

0 comments on commit 9fdd36d

Please sign in to comment.