Skip to content

Commit

Permalink
Add GitHub action to publish Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
codedmonkey committed May 27, 2024
1 parent 1f2fd59 commit 048a8ac
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Docker image

on: push

jobs:
publish-images:
name: Publish Docker Images
runs-on: ubuntu-latest
steps:
-
name: Check out repo
uses: actions/checkout@v4

-
name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}

-
name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

-
name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 048a8ac

Please sign in to comment.