eco-gotest:v4.14.0 #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Image - CI | ||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- main | ||
- 'release-\d.\d\d' | ||
jobs: | ||
build: | ||
name: Build and push docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
run: | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set image tag | ||
shell: bash | ||
run: | | ||
image_tag=latest | ||
if [ ${{ github.ref }} != 'refs/heads/main' ]; then | ||
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | ||
version_digits=$(echo ${branch} | tr -d -c 0-9) | ||
image_tag=v$(echo ${version_digits} | cut -b 1).$(echo ${version_digits:1}).0 | ||
fi | ||
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_OUTPUT | ||
id: set_image_tag | ||
- name: Build docker image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: eco-gotests | ||
tags: ${{ steps.set_image_tag.outputs.IMAGE_TAG }} | ||
containerfiles: | | ||
./Dockerfile | ||
archs: amd64, arm64 | ||
- name: Push To quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: quay.io/ocp-edge-qe | ||
username: ${{ secrets.OCP_EDGE_QE_QUAY_USER }} | ||
password: ${{ secrets.OCP_EDGE_QE_QUAY }} | ||
- name: Print image url | ||
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |