Skip to content

Commit bc6640a

Browse files
added the yaml file (#33)
1 parent b84340f commit bc6640a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # Saves time by not fetching other branches
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Login to GitHub Container Registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push Docker image
31+
id: docker_build
32+
uses: docker/build-push-action@v6
33+
with:
34+
context: .
35+
push: true
36+
tags: ghcr.io/${{ github.repository }}:latest
37+
cache-from: type=gha
38+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)