Skip to content

Docker Publish

Docker Publish #3

name: Docker Publish
on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the Docker image"
required: true
default: "latest"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@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 Docker image
run: docker build -t ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }} .
- name: Push Docker image
run: docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}