Skip to content

chore: Add Docker build pipeline workflow #1

chore: Add Docker build pipeline workflow

chore: Add Docker build pipeline workflow #1

Workflow file for this run

# It automatically builds your Docker image and pushes it to GHCR
name: Build and Push Docker Image
# We will run this workflow every time you push to the 'main' branch
on:
push:
branches: [ "main" ]
jobs:
build-and-push:
runs-on: ubuntu-latest # Use a standard GitHub-hosted runner
permissions:
contents: read
packages: write # Give the job permission to write to GHCR
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true # Push the image after building
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}