Skip to content

Merge pull request #7 from imrasalghul/feat/image-hardening #4

Merge pull request #7 from imrasalghul/feat/image-hardening

Merge pull request #7 from imrasalghul/feat/image-hardening #4

Workflow file for this run

name: Release Image
on:
release:
types:
- published
push:
tags:
- "v*"
workflow_dispatch:
concurrency:
group: release-image-${{ github.ref }}
cancel-in-progress: false
jobs:
publish-ghcr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=sha
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}