Skip to content

Commit 9bdf94b

Browse files
committed
Github action to build and push Docker container
1 parent 82b45ee commit 9bdf94b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/docker.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Push Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Login to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ secrets.ACTION_USER }}
26+
password: ${{ secrets.ACTION_TOKEN }}
27+
28+
- name: Build and push Docker image
29+
uses: docker/build-push-action@v5
30+
with:
31+
context: .
32+
push: true
33+
tags: ghcr.io/${{ github.repository }}/modelbricks:${{ github.sha.substring(0, 7) }}

0 commit comments

Comments
 (0)