Skip to content

Update publish.yml #122

Update publish.yml

Update publish.yml #122

Workflow file for this run

name: Publish Images
on:
workflow_dispatch:
push:
branches: [ "feature/docker-compose-build" ]
release:
types: [published]
permissions:
contents: read
jobs:
docker:
name: Publish to Docker
runs-on: guardian-linux-medium
permissions:
id-token: write
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Conditional values for Github Action
uses: step-security/action-cond@615a91598eb99288b89cf1b3da31ac33cdd72b19 # v1.2.2
id: latestTag
with:
cond: ${{ github.event.release.target_commitish == 'main' }}
if_true: 'latest'
if_false: 'hotfix'
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
with:
path: guardian-service
# Add support for more platforms with QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d # v2.1.5
with:
workload_identity_provider: 'projects/101730247931/locations/global/workloadIdentityPools/hedera-registry-pool/providers/hedera-registry-gh-actions'
service_account: '[email protected]'
token_format: 'access_token'
- name: Docker Login
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: 'gcr.io' # or REGION-docker.pkg.dev
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
- name: application-events-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./application-events/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/application-events:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/application-events:latest'
- name: application-events
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./application-events/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/application-events:${{ steps.package-version.outputs.current-version}}'
- name: ai-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./ai-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/ai-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/ai-service:latest'
- name: ai-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./ai-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/ai-service:${{ steps.package-version.outputs.current-version}}'
- name: logger-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./logger-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/logger-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/logger-service:latest'
- name: logger-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./logger-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/logger-service:${{ steps.package-version.outputs.current-version}}'
- name: notification-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./notification-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/notification-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/notification-service:latest'
- name: notification-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./notification-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/notification-service:${{ steps.package-version.outputs.current-version}}'
- name: auth-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./auth-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/auth-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/auth-service:latest'
- name: auth-service-demo-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./auth-service/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/auth-service-demo:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/auth-service-demo:latest'
- name: auth-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./auth-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/auth-service:${{ steps.package-version.outputs.current-version}}'
- name: auth-service-demo
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./auth-service/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/auth-service-demo:${{ steps.package-version.outputs.current-version}}'
- name: api-gateway-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./api-gateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/api-gateway:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/api-gateway:latest'
- name: api-gateway-demo-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./api-gateway/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/api-gateway-demo:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/api-gateway-demo:latest'
- name: api-gateway
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./api-gateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/api-gateway:${{ steps.package-version.outputs.current-version}}'
- name: api-gateway-demo
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./api-gateway/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/api-gateway-demo:${{ steps.package-version.outputs.current-version}}'
- name: policy-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./policy-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/policy-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/policy-service:latest'
- name: policy-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./policy-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/policy-service:${{ steps.package-version.outputs.current-version}}'
- name: guardian-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./guardian-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/guardian-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/guardian-service:latest'
- name: guardian-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./guardian-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/guardian-service:${{ steps.package-version.outputs.current-version}}'
- name: worker-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./worker-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/worker-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/worker-service:latest'
- name: worker-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./worker-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/worker-service:${{ steps.package-version.outputs.current-version}}'
- name: queue-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./queue-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/queue-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/queue-service:latest'
- name: queue-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./queue-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/queue-service:${{ steps.package-version.outputs.current-version}}'
- name: topic-viewer-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./topic-viewer/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/topic-viewer:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/topic-viewer:latest'
- name: topic-viewer
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./topic-viewer/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/topic-viewer:${{ steps.package-version.outputs.current-version}}'
- name: mrv-sender-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./mrv-sender/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/mrv-sender:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/mrv-sender:latest'
- name: mrv-sender
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./mrv-sender/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/mrv-sender:${{ steps.package-version.outputs.current-version}}'
- name: analytics-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./analytics-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/analytics-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/analytics-service:latest'
- name: analytics-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./analytics-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/analytics-service:${{ steps.package-version.outputs.current-version}}'
- name: web-proxy-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./web-proxy/Dockerfile.ci
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/frontend:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/frontend:latest'
- name: web-proxy
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./web-proxy/Dockerfile.ci
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/frontend:${{ steps.package-version.outputs.current-version}}'
- name: web-proxy-demo-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./web-proxy/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/frontend-demo:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/frontend-demo:latest'
- name: web-proxy-demo
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./web-proxy/Dockerfile.demo
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/frontend-demo:${{ steps.package-version.outputs.current-version}}'
- name: indexer-worker-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-worker-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-worker-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/indexer-worker-service:latest'
- name: indexer-worker-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-worker-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-worker-service:${{ steps.package-version.outputs.current-version}}'
- name: indexer-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/indexer-service:latest'
- name: indexer-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-service/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-service:${{ steps.package-version.outputs.current-version}}'
- name: indexer-api-gateway-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-api-gateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-api-gateway:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/indexer-api-gateway:latest'
- name: indexer-api-gateway
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-api-gateway/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-api-gateway:${{ steps.package-version.outputs.current-version}}'
- name: indexer-web-proxy-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-web-proxy/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-web-proxy:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/indexer-web-proxy:latest'
- name: indexer-web-proxy
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./indexer-web-proxy/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: 'gcr.io/hedera-registry/indexer-web-proxy:${{ steps.package-version.outputs.current-version}}'