Skip to content

Dockerize"ish"

Dockerize"ish" #1

Workflow file for this run

name: keras-ocr-docker-image
on:
pull_request:
branches: [ "main" ]
types: [ "closed" ]
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
IMAGE_NAME: keras-ocr
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get short SHA
run: echo "GITHUB_SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$GITHUB_SHA_SHORT
docker push $IMAGE_ID:$GITHUB_SHA_SHORT