Skip to content

Commit 7a68c36

Browse files
committed
build and push image to ghcr
Signed-off-by: Kartikey Mamgain <[email protected]>
1 parent 0e80cd9 commit 7a68c36

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/push-image.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Push open connector image to ghcr.io
2+
on:
3+
push:
4+
branches: ['main']
5+
tags: ["v*"]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}/open-connector
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Log in to container registry
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ github.repository_owner }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
registry: ${{ env.REGISTRY }}
27+
- name: Generate container metadata
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
- name: Build and push
33+
uses: docker/build-push-action@v5
34+
with:
35+
context: /
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}
38+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)