Skip to content

Commit c463c66

Browse files
authored
Merge pull request #122 from georgian-io/git-action-docker
[CI] Publish to Github Packages (ghcr)
2 parents b281456 + 95c5afa commit c463c66

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Packages CD
2+
on:
3+
release:
4+
types: [published]
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
jobs:
9+
build-and-push-image:
10+
name: Build and Push Image
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Log in to the Container registry
19+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
20+
with:
21+
registry: ${{ env.REGISTRY }}
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
27+
with:
28+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
31+
with:
32+
context: .
33+
push: true
34+
tags: ${{ steps.meta.outputs.tags }}
35+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)