Skip to content

Ccl 278/create docker image #11

Ccl 278/create docker image

Ccl 278/create docker image #11

Workflow file for this run

name: Build and Publish Docker Image
on:
pull_request:
paths:
- .github/workflows/docker-build.yml
- build.sh
- Dockerfile
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPO_NAME: ${{ github.event.repository.name }}
jobs:
build-and-publish:
permissions:
packages: write
contents: read
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Run build script
run: |
bash build.sh
- name: Login to ghcr
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Publish Docker Image
run: |
tags=$(docker image inspect ghcr.io/ukhomeoffice/cc-lza-validator:latest | jq '.[0].RepoTags')
echo $tags
for tag in $tags; do
docker push $tag
done