Skip to content

[CZID-8390] Add sqs step notifications (#116) #151

[CZID-8390] Add sqs step notifications (#116)

[CZID-8390] Add sqs step notifications (#116) #151

name: Push Docker image to GH packages
on:
push:
branches:
- 'main'
jobs:
build_docker_images:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag ${{ github.repository }} --label "runnumber=${GITHUB_RUN_ID}"
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
set -x
IMAGE_ID=ghcr.io/${{ github.repository }}
VERSION=$(cat version)
SHA_TAG=sha-${GITHUB_SHA:0:8}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag ${{ github.repository }} $IMAGE_ID:latest
docker tag ${{ github.repository }} $IMAGE_ID:$SHA_TAG
docker tag ${{ github.repository }} $IMAGE_ID:$VERSION
docker push $IMAGE_ID:latest
docker push $IMAGE_ID:$SHA_TAG
docker push $IMAGE_ID:$VERSION
- name: Checkout
uses: actions/checkout@v2