Add image action

This commit is contained in:
DominicJamesWhite 2025-04-10 12:53:37 +02:00
parent 88b150057e
commit 7d84ae66de

38
.github/workflows/build-push.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the 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/dominicjameswhite/canyonchat
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}