Skip to content

Publish Docker Image #1207

Publish Docker Image

Publish Docker Image #1207

name: Publish Docker Image
on:
push:
branches:
- saga
paths:
- Dockerfile
- .github/workflows/publish-docker.yaml
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine GitHub Container Registry repo name
run: |
DOCKER_REPO_NAME=`echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]'`
echo "DOCKER_REPO_NAME=${DOCKER_REPO_NAME}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
tags: ghcr.io/${{ env.DOCKER_REPO_NAME }}:saga
push: true
- name: Inspect image
run: |
docker image inspect ghcr.io/${{ env.DOCKER_REPO_NAME }}:saga