Skip to content

[RM-84612] added useTransport option #49

[RM-84612] added useTransport option

[RM-84612] added useTransport option #49

name: Dev build and publish Docker distributions to Github Container Registry ghcr.io
on:
push:
branches-ignore:
- master
- version-*
- dependabot**
paths-ignore:
- README.md
- gradle.properties
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# Prepare custom build version
- name: Get branch name
id: branch
run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/}
- name: Get release_version
id: ver
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: release_version
- name: Get SHA of the commit
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build custom release version
id: release_ver
run: echo value="${{ steps.ver.outputs.release_version }}-${{ steps.branch.outputs.branch_name }}-${{ github.run_id }}-${{ steps.sha.outputs.sha_short }}" >> $GITHUB_OUTPUT
- name: Show custom release version
run: echo ${{ steps.release_ver.outputs.value }}
# Build and publish image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: echo "::set-output name=REPOSITORY_NAME::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')"
id: meta
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.release_ver.outputs.value }}
labels: com.exactpro.th2.${{ steps.meta.outputs.REPOSITORY_NAME }}=${{ steps.ver.outputs.value }}
build-args: |
release_version=${{ steps.read_property.outputs.value }}