Skip to content

Commit

Permalink
build(docker): improve docker build and push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cshum committed Aug 1, 2022
1 parent 39235b2 commit 7509ef5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
if: github.repository == 'cshum/imagor'
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -73,6 +74,18 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Extract Docker metadata on fork
if: github.repository != 'cshum/imagor'
id: meta-fork
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image on semver
Expand Down

0 comments on commit 7509ef5

Please sign in to comment.