Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit f587cd0

Browse files
committed
adds workflow that creates 'release' tag (along with version tag) when released
1 parent 4976b4f commit f587cd0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/release.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release Docker Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Log into the Container registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ${{ env.REGISTRY }}
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Extract metadata for Docker image
26+
id: meta
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
30+
tags: |
31+
type=semver,pattern={{version}},value=${{ github.event.release.tag_name }}
32+
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name }}
33+
type=semver,pattern={{major}},value=${{ github.event.release.tag_name }}
34+
type=raw,value=release
35+
type=sha,format=long
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Build and push Docker image
41+
uses: docker/build-push-action@v5
42+
with:
43+
context: .
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
platforms: linux/amd64,linux/arm64
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)