Skip to content

Commit 092ac5c

Browse files
committed
add build and push
1 parent 456bbfa commit 092ac5c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,33 @@ jobs:
5353
with:
5454
image: ${{ env.IMAGE_NAME }}:ci
5555
run: pytest
56+
build:
57+
name: Build and push image
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Login to GitHub Container Registry
61+
uses: docker/login-action@v3
62+
with:
63+
registry: ${{ env.REGISTRY }}
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
- name: Generate metadata
67+
id: meta
68+
uses: docker/metadata-action@v5
69+
with:
70+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
71+
tags: |
72+
type=ref,event=branch
73+
type=ref,event=pr
74+
type=sha
75+
- name: Build image
76+
uses: docker/build-push-action@v5
77+
if: github.ref == 'refs/heads/main'
78+
with:
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
target: prod
82+
load: true
83+
cache-from: type=gha
84+
cache-to: type=gha,mode=max
85+
push: true

0 commit comments

Comments
 (0)