Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Rajpal Chauhan <[email protected]>
  • Loading branch information
rajpalc7 committed Jan 31, 2024
1 parent fadde47 commit ff3a2cd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:

- name: Prepare docker tags for image
id: meta
if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service)
uses: docker/metadata-action@v5
with:
images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }}
Expand All @@ -100,10 +101,10 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,value=latest
if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service)
- name: Build and push Docker image
id: docker_build
if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service)
uses: docker/build-push-action@v5
with:
context: ${{ matrix.SOURCE_CONTEXT_DIR }}
Expand All @@ -113,55 +114,53 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service)

- name: Pull database image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
docker pull ${{ matrix.BUILDER_IMAGE }}
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
- name: Build database image
id: build_image
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
uses: redhat-actions/s2i-build@v2
with:
path_context: ${{ matrix.PATH }}
# Builder image for a java project
builder_image: ${{ matrix.BUILDER_IMAGE }}
image: dts-endorser-service/${{ matrix.service }}
tags: ${{ steps.meta.outputs.tags }}
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)

- name: Push database image
id: push
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.build_image.outputs.tags }}
image: ${{ steps.build_image.outputs.image }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io/bcgov
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)

- name: Display ${{ matrix.service }} image results
id: digests
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
run: |
echo "registry_path=${{ steps.push.outputs.registry-paths }}"
digest=${{ steps.push.outputs.digest }}
echo 'digest=${digest}'
echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT
if: contains(fromJSON('["aries-endorser-db"]'), matrix.service)
- name: Display ${{ matrix.service}} image results
id: digest
if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service)
run: |
echo 'imageid=${{ steps.docker_build.outputs.imageid }}'
digest=${{ steps.docker_build.outputs.digest }}
echo 'digest=${digest}'
echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service)

# deploy2dev:
# needs: build
# env:
Expand Down

0 comments on commit ff3a2cd

Please sign in to comment.