Skip to content

Commit

Permalink
Update publish-docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SwedishSubmarine authored Nov 16, 2024
1 parent fd53fd6 commit 2047d15
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
name: Publish Docker Image

on:
release:
types: [ published ]

env:
# GitHub repository is basically "$org/$repo"
IMAGE_NAME: ${{ github.repository }}
push:
tags: ["v*.*.*"]

jobs:
build-and-push-image:
runs-on: ubuntu-latest
uses: dtekcth/workflows/.github/workflows/[email protected]
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v2

# User triggering the action is authenticated to the container registry
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Basically sets the image tag from the release
- name: Extract metadata for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 2047d15

Please sign in to comment.