Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 264704a

Browse files
authoredAug 21, 2024··
Create a Github action to build and push to GHCR
1 parent d0c4e3c commit 264704a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
 

‎.github/workflows/docker-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "azure-openai" ]
6+
pull_request:
7+
branches: [ "azure-openai" ]
8+
9+
# jobs:
10+
11+
# build:
12+
13+
# runs-on: ubuntu-latest
14+
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
# - name: Build the Docker image
18+
# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
31+
- name: Log in to GitHub Container Registry
32+
uses: docker/login-action@v2
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GHCR_TOKEN }}
37+
38+
- name: Build and push container image
39+
uses: docker/build-push-action@v3
40+
with:
41+
push: true
42+
tags: ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)
Please sign in to comment.