Skip to content

Build and publish Docker image #1

Build and publish Docker image

Build and publish Docker image #1

Workflow file for this run

name: Build and publish Docker image
on:
workflow_dispatch:
inputs:
tag:
description: 'Container Tag'
required: true
env:
REGISTRY: ghcr.io
OWNER: ${{ github.repository_owner }}
IMAGE_NAME: ${{ github.repository_owner }}/mjj
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max