Skip to content

ci: add docker (#1)

ci: add docker (#1) #6

Workflow file for this run

name: Build docker
on:
workflow_dispatch:
push:
branches:
- "main"
- "ci/**"
paths:
- ".github/workflows/build_docker.yml"
- "Dockerfile"
- "requirements.txt"
- "src/**"
- "**.py"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io${{ env.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: "ghcr.io/mirrorchyan/billing-backend:latest"
labels: ${{ steps.meta.outputs.labels }}