Skip to content

Commit

Permalink
fix docker release yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
seddonm1 committed Jul 19, 2023
1 parent b1c0484 commit 9a0599d
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,36 @@ name: Build and publish a Docker image to ghcr.io
on:
release:
types: [ published ]
push:
branches: [ master ]

jobs:
docker_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and publish a Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@master
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/thedatabaseme/hello-world
flavor: latest=true
tags: |
type=semver,pattern={{version}}
- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
image_name: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
context: .
file: Dockerfile
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 9a0599d

Please sign in to comment.