Skip to content

feat: add docker build #2

feat: add docker build

feat: add docker build #2

Workflow file for this run

name: Create and publish a Docker image
on:
push:
branches: ['release']
pull_request:
paths:
- Dockerfile
- .github/workflows/docker.yml
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@main
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@main
with:
images: ghcr.io/${{ github.repository }}/drafter
- name: Build and push Docker image
uses: docker/build-push-action@master
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: drafter-build