Add container publish workflow

This commit is contained in:
Nate Emmert committed 2026-03-16 12:38:43 -04:00
1 parent b242232e0c
commit 30045c696e
1 file changed
+47
+47
View File
@@ -0,0 +1,47 @@
name: Publish Container
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/nmemmert/weather
tags: |
type=raw,value=latest
type=sha
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: ./app
file: ./app/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}