Skip to content

Commit 2b856b0

Browse files
committed
SBCOSS-399: created workflow to publish image to ghcr
1 parent 1c068d9 commit 2b856b0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/ghcr-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'release*'
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Set up Docker image name
29+
id: vars
30+
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository }}" >> $GITHUB_ENV
31+
32+
- name: Build Docker image
33+
run: |
34+
docker build -t $IMAGE_NAME:${{ github.ref_name }} .
35+
36+
- name: Push Docker image
37+
run: |
38+
docker push $IMAGE_NAME:${{ github.ref_name }}

0 commit comments

Comments
 (0)