Skip to content

Commit

Permalink
fix: workflow for docker with simplified meta
Browse files Browse the repository at this point in the history
  • Loading branch information
dundee committed Feb 15, 2024
1 parent 9d88ea1 commit 441172f
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
name: Build and publish a Docker image
name: Docker

on:
workflow_dispatch:
push:
branches: ['master']
branches:
- 'master'
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
-
name: Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
-
name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
-
name: Docker meta
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down

0 comments on commit 441172f

Please sign in to comment.