Skip to content

Build/Push Docker Image to ghcr #1

Build/Push Docker Image to ghcr

Build/Push Docker Image to ghcr #1

Workflow file for this run

name: Build and Push Docker Image to GitHub Container Registry
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image to GitHub Container Registry
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/madara:latest
ghcr.io/${{ github.repository_owner }}/madara:${{ github.event.release.tag_name }}
labels: |
org.opencontainers.image.source=${{ github.repository.html_url }}
org.opencontainers.image.version=${{ github.event.release.tag_name }}
- name: Post successful message
run: echo "Docker image built and pushed successfully"