Skip to content

Build and Publish Docker Image #14

Build and Publish Docker Image

Build and Publish Docker Image #14

name: Build and Publish Docker Image
on:
workflow_run:
workflows:
- Update Tag and Commit
types:
- completed
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/training-github-actions:latest