Skip to content

Commit

Permalink
Add a github actions docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Jul 30, 2024
1 parent 5006a36 commit 4bf943f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Docker image
on:
push:
tags:
- "v*"
branches:
- "*"

jobs:
docker:
name: Build Docker image and push to ghcr.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' && !contains(github.ref_name, '/') }}
- uses: docker/login-action@v2
name: Login to ghcr.io
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
name: Build and push image
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 4bf943f

Please sign in to comment.