Skip to content

Commit

Permalink
add: (.github/) workflows/docker-release.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
gottaeat committed Jul 24, 2024
1 parent 785b5c7 commit 179e375
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: publish release image

on:
release:
types: [published]

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: set up docker buildx
uses: docker/setup-buildx-action@v3

- name: log in to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: build and push release
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64

0 comments on commit 179e375

Please sign in to comment.