Skip to content

Commit 6ddf9d2

Browse files
authored
Create docker-build.yml
1 parent 17c98a8 commit 6ddf9d2

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to GitHub Container Registry
17+
uses: docker/login-action@v3
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Build Docker Image
24+
run: |
25+
docker build -t ghcr.io/${{ github.repository }}:${{ github.ref_name }} .
26+
27+
- name: Push Docker Image to GitHub Container Registry
28+
run: |
29+
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)