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

Commit 9628be6

Browse files
authored
Add github workflow for ghcr release on new releases (#122)
1 parent 3d4e7c0 commit 9628be6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/docker.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tag Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Log into the Container registry
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata for the Docker image
29+
id: meta
30+
uses: docker/metadata-action@v4
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
34+
- name: Build and push the Docker image
35+
uses: docker/build-push-action@v4
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)