Skip to content

Commit

Permalink
Merge pull request #6 from CSR2017/ADMINAPI-346-temp-2
Browse files Browse the repository at this point in the history
Have duplication build steps for database image
  • Loading branch information
CSR2017 authored Jul 24, 2023
2 parents 73b669a + 618ca41 commit 72b0f4a
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions .github/workflows/on-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,6 @@ jobs:
docker-publish:
name: Publish to Docker Hub
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./Docker/api-pgsql.Dockerfile
image: ${{ env.IMAGE_NAME }}
- dockerfile: ./Docker/Settings/DB-Admin/pgsql/Dockerfile
image: ${{ env.DATABASE_IMAGE_NAME }}
needs:
- publish-package
steps:
Expand Down Expand Up @@ -301,35 +293,38 @@ jobs:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract metadata (tags, labels) for admin api image
id: metaapi
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
with:
images: ${{ matrix.image }}
# ${{ env.IMAGE_NAME }}
# ${{ env.DATABASE_IMAGE_NAME }}
images: ${{ env.IMAGE_NAME }}

- name: Build and push admin api image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
context: "{{defaultContext}}"
context: "{{defaultContext}}:Docker"
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:pre
cache-to: type=inline
build-args: VERSION=${{ steps.prepare-tags.outputs.VERSION }}
# file: api-pgsql.Dockerfile
file: ${{ matrix.dockerfile }}
file: api-pgsql.Dockerfile
tags: ${{ steps.prepare-tags.outputs.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.metaapi.outputs.labels }}
push: true

# - name: Build and push admin api database image
# uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
# with:
# context: "{{defaultContext}}:Docker/Settings/DB-Admin/pgsql"
# cache-from: type=registry,ref=${{ env.DATABASE_IMAGE_NAME }}:pre
# cache-to: type=inline
# build-args: VERSION=${{ steps.prepare-tags.outputs.VERSION }}
# file: Dockerfile
# tags: ${{ steps.prepare-tags.outputs.TAGS }}
# labels: ${{ steps.meta.outputs.labels }}
# push: true
- name: Extract metadata (tags, labels) for admin api database image
id: metadatabase
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
with:
images: ${{ env.DATABASE_IMAGE_NAME }}

- name: Build and push admin api database image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
context: "{{defaultContext}}:Docker/Settings/DB-Admin/pgsql"
cache-from: type=registry,ref=${{ env.DATABASE_IMAGE_NAME }}:pre
cache-to: type=inline
build-args: VERSION=${{ steps.prepare-tags.outputs.VERSION }}
file: Dockerfile
tags: ${{ steps.prepare-tags.outputs.TAGS }}
labels: ${{ steps.metadatabase.outputs.labels }}
push: true

0 comments on commit 72b0f4a

Please sign in to comment.