Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandhya1874 committed Oct 8, 2024
1 parent b35ec2b commit e55658a
Showing 1 changed file with 32 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,41 @@ inputs:
description: App version
required: true
type: string
docker_registry_username:
description: Docker registry username
required: true
type: string
docker_registry_token:
description: Docker registry username
required: true
type: string
git_head_ref:
description: git head ref
required: true
type: string
git_ref_name:
description: git branch name
required: true
type: string

runs:
using: "composite"
steps:
- name: Set version
run: |
echo "version=$app_version" | tee -a "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Docker login if Docker registry is quay.io
if: ${{ inputs.docker_registry == 'quay.io' }}
uses: docker/login-action@v2
with:
registry: ${{ inputs.docker_registry }}
username: ${{ secrets.HMPPS_QUAYIO_USER }}
password: ${{ secrets.HMPPS_QUAYIO_TOKEN }}

# - uses: actions/checkout@v4
# - uses: docker/setup-qemu-action@v2
# - uses: docker/setup-buildx-action@v2

# - name: Docker login if Docker registry is quay.io
# uses: docker/login-action@v2
# with:
# registry: ${{ inputs.docker_registry }}
# username: ${{ inputs.docker_registry_username }}
# password: ${{ inputs.docker_registry_token }}
- name: Docker login if Docker registry is ghcr.io
if: ${{ inputs.docker_registry == 'ghcr.io' }}
uses: docker/login-action@v2
with:
registry: ${{ inputs.docker_registry }}
username: ${{ github.actor }}
password: ${{ github.token }}

# - name: Build Docker images
# uses: docker/build-push-action@v4
# with:
# cache-from: type=gha
# cache-to: type=gha,mode=max
# platform: linux/amd64,linux/arm64
# context: .
# push: ${{ inputs.push }}
# provenance: false
# build-args: |
# "BUILD_NUMBER=${{ inputs.app_version }}"
# "GIT_REF=${{ inputs.git_head_ref }}"
# "GIT_BRANCH=${{ inputs.git_ref_name }}"
# tags: |
# ${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ inputs.repository_name }}:latest
# ${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ inputs.repository_name }}:${{ inputs.app_version }}
- name: Build Docker images
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
push: ${{ inputs.push }}
provenance: false
build-args: |
"BUILD_NUMBER=${{ steps.version.outputs.version }}"
"GIT_REF=$${{ github.head_ref }}"
"GIT_BRANCH=$${{ github.ref_name }}"
tags: |
${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ github.event.repository.name }}:latest
${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ github.event.repository.name }}:${{ steps.version.outputs.version }}

0 comments on commit e55658a

Please sign in to comment.