File tree Expand file tree Collapse file tree 3 files changed +52
-8
lines changed Expand file tree Collapse file tree 3 files changed +52
-8
lines changed Original file line number Diff line number Diff line change 88
99env :
1010 REGISTRY : ghcr.io
11+ PUSH : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
1112
1213jobs :
1314 bake :
2627 - name : Build and Push
2728 uses : docker/bake-action@37816e747588cb137173af99ab33873600c46ea8 # v6
2829 with :
29- push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
30+ push : ${{ env.PUSH == 'true' }}
31+ env :
32+ BUILD_VERSION : ${{ env.PUSH == 'true' && 'main' || 'pr' }}
Original file line number Diff line number Diff line change 1+ name : Publish Images
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+
8+ env :
9+ REGISTRY : ghcr.io
10+
11+ jobs :
12+ bake :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
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 : ${{ env.REGISTRY }}
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+
28+ - name : Build and Push
29+ uses : docker/bake-action@v4
30+ with :
31+ push : true
32+ env :
33+ BUILD_VERSION : ${{ github.ref_name }}
Original file line number Diff line number Diff line change 1- group "default" {
2- targets = [" python" ]
1+ variable "BUILD_VERSION" {
2+ default = " dev"
3+ }
4+
5+ variable "PYTHON_VERSION" {
6+ default = " 3.13.5"
37}
48
5- variable "PYTHON_TAG " {
6- default = " 3.13.5- slim-bookworm"
9+ variable "PYTHON_BASE_VARIANT " {
10+ default = " slim-bookworm"
711}
812
9- variable "PYTHON_SHA " {
13+ variable "PYTHON_BASE_SHA " {
1014 default = " f2fdaec50160418e0c2867ba3e254755edd067171725886d5d303fd7057bbf81"
1115}
1216
17+ group "default" {
18+ targets = [" python" ]
19+ }
20+
1321target "python" {
1422 context = " docker/python"
1523 args = {
16- PYTHON_TAG_SHA = " ${ PYTHON_TAG } @sha256:${ PYTHON_SHA } "
24+ PYTHON_TAG_SHA = " ${ PYTHON_VERSION } - ${ PYTHON_BASE_VARIANT } @sha256:${ PYTHON_BASE_SHA } "
1725 }
1826 tags = [
19- " ghcr.io/powerhome/cdk8s-cmp-python:${ PYTHON_TAG } "
27+ " ghcr.io/powerhome/cdk8s-cmp-python:${ BUILD_VERSION } - ${ PYTHON_VERSION } "
2028 ]
2129}
You can’t perform that action at this time.
0 commit comments