Skip to content

Commit dce74fa

Browse files
committed
Add docker image build workflow
1 parent b1de4ba commit dce74fa

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ docker/* ]
6+
7+
jobs:
8+
login:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Set Branch Name
15+
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/docker/})" >> $GITHUB_ENV
16+
17+
- name: Login to GitHub Container Registry
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Build the Docker image
25+
run: |
26+
docker build . -t ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}
27+
docker push ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}

0 commit comments

Comments
 (0)