Skip to content

Commit

Permalink
ci: configure Docker Hub for publishing the revision
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Shynbuiev <[email protected]>
  • Loading branch information
yshyn-iohk committed Feb 12, 2025
1 parent fda0f11 commit 0754c43
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 23 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ jobs:
node-version: "lts/*"

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GITHUB_ACTOR }}
password: ${{ env.GITHUB_TOKEN }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -97,18 +96,38 @@ jobs:
echo "REVISION_VERSION=${REVISION_VERSION}" >> $GITHUB_ENV
echo "BUILD_VERSION=${BUILD_VERSION}" >> $GITHUB_ENV
- name: Build and push Docker image
- name: Build Docker Image
run: |
sbt "set version := \"${{ env.BUILD_VERSION }}\"" "docker:stage"
docker buildx build --platform=linux/arm64,linux/amd64 --push -t ghcr.io/hyperledger/identus-cloud-agent:${{ env.BUILD_VERSION}} ./cloud-agent/service/server/target/docker/stage
docker buildx build --platform=linux/arm64,linux/amd64 --push -t ${{ vars.DOCKERHUB_ORG }}/cloud-agent:${{ env.BUILD_VERSION }} ./cloud-agent/service/server/target/docker/stage --load
- name: Trigger helm chart update
uses: peter-evans/repository-dispatch@v3
- name: Docker Metadata Action
id: meta
uses: docker/metadata-action@v5
with:
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
repository: input-output-hk/atala-prism-helm-charts
event-type: build-chart-package
client-payload: '{"version": "${{ env.BUILD_VERSION }}", "chart": "cloud-agent"}'
images: ${{ vars.DOCKERHUB_ORG }}/cloud-agent
tags: |
type=sha,format=short
type=ref,event=branch
type=semver,pattern={{version}}
labels: |
org.opencontainers.image.title=cloud-agent
org.opencontainers.image.description=Hyperledger Identus Cloud Agent
org.opencontainers.image.url=https://github.com/hyperledger-identus/cloud-agent
org.opencontainers.license=Apache-2.0
latest=${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}
snapshot=${{ github.ref != 'refs/heads/main' && 'true' || 'false' }}
- name: Push Docker Image
id: push
uses: docker/build-push-action@v6
with:
context: ./cloud-agent/service/server/target/docker/stage
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
push: ${{ steps.meta.outputs.tags != '' }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}

- name: Build Cloud-Agent Open API Specification
id: build-oas
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/oasdiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ permissions:
pull-requests: write
actions: write

# https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/prism-agent-v1.29.0/prism-agent/service/api/http/prism-agent-openapi-spec.yaml
# https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml
# https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/prism-agent-v1.29.0/prism-agent/service/api/http/prism-agent-openapi-spec.yaml
# https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml

jobs:
oasdiff-breaking:
Expand All @@ -40,13 +40,13 @@ jobs:
run: |
echo Base tag: "$BASE_TAG"
if [[ "$BASE_TAG" =~ cloud-agent-v* ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$BASE_TAG" =~ prism-agent-v* ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${BASE_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$BASE_TAG" == 'main' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${BASE_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' ]]; then
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "BASE_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/main/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
fi
- name: Resolve the revision OpenAPI spec URL
Expand All @@ -57,13 +57,13 @@ jobs:
run: |
echo Revision tag: "$REV_TAG"
if [[ "$REV_TAG" =~ cloud-agent-v* ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "REV_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$REV_TAG" =~ prism-agent-v* ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "REV_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${REV_TAG}/prism-agent/service/api/http/prism-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$REV_TAG" == 'main' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "REV_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${REV_TAG}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
elif [[ "$GITHUB_EVENT_NAME" == 'pull_request' ]]; then
echo "REV_URL=https://raw.githubusercontent.com/hyperledger/identus-cloud-agent/${BRANCH_NAME}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
echo "REV_URL=https://raw.githubusercontent.com/hyperledger-identus/cloud-agent/${BRANCH_NAME}/cloud-agent/service/api/http/cloud-agent-openapi-spec.yaml" >> "$GITHUB_ENV"
fi
- name: Check URLS
Expand Down
2 changes: 1 addition & 1 deletion cloud-agent/client/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
description="Identus Cloud Agent Client",
author="Allain Magyar",
author_email="",
url="https://github.com/hyperledger/identus-cloud-agent",
url="https://github.com/hyperledger-identus/cloud-agent",
keywords=["Identus Cloud Agent Client"],
python_requires=">=3.7",
install_requires=REQUIRES,
Expand Down

0 comments on commit 0754c43

Please sign in to comment.