8686
8787 push-image :
8888 if : github.event_name == 'release' && github.event.action== 'published'
89- name : Push Docker image to GitHub Packages
89+ name : Push OCI images to GitHub Packages
9090 runs-on : ubuntu-latest
9191 strategy :
9292 matrix :
@@ -95,72 +95,77 @@ jobs:
9595 steps :
9696 - name : Check out the repo
9797 uses : actions/checkout@v2
98- - name : Log in to GitHub Docker Registry
99- uses : docker/login-action@v1
100- with :
101- registry : ghcr.io
102- username : ${{ github.actor }}
103- password : ${{ secrets.GITHUB_TOKEN }}
104- - name : Build zot container image
105- uses : docker/build-push-action@v2
98+ - name : Build and push zot container image
99+ uses : project-stacker/stacker-build-push-action@main
106100 with :
101+ file : ' stacker.yaml'
107102 build-args : |
108103 COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
109104 OS=${{ matrix.os }}
110105 ARCH=${{ matrix.arch }}
111- push : true
112- file : Dockerfile
113- tags : |
114- ghcr.io/ ${{ github.repository }}-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}
115- ghcr.io/ ${{ github.repository }}-${{ matrix.os }}-${{ matrix.arch }}:latest
116- - name : Build zot-minimal container image
117- uses : docker/ build-push-action@v2
106+ REPO_NAME=zot-${{ matrix.os }}-${{ matrix.arch }}
107+ url : docker://ghcr.io/${{ github.repository_owner }}
108+ tags : ${{ github.event.release.tag_name }} latest
109+ username : ${{ github.actor }}
110+ password : ${{ secrets.GITHUB_TOKEN }}
111+ - name : Build and push zot-minimal container image
112+ uses : project-stacker/stacker- build-push-action@main
118113 with :
114+ file : ' stacker.yaml'
119115 build-args : |
120116 COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
121117 OS=${{ matrix.os }}
122118 ARCH=${{ matrix.arch }}
123- push : true
124- file : Dockerfile-minimal
125- tags : |
126- ghcr.io/${{ github.repository }}-minimal-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}
127- ghcr.io/${{ github.repository }}-minimal-${{ matrix.os }}-${{ matrix.arch }}:latest
128- - name : Build zot-exporter container image
129- uses : docker/build-push-action@v2
119+ EXT=-minimal
120+ REPO_NAME=zot-minimal-${{ matrix.os }}-${{ matrix.arch }}
121+ url : docker://ghcr.io/${{ github.repository_owner }}
122+ tags : ${{ github.event.release.tag_name }} latest
123+ username : ${{ github.actor }}
124+ password : ${{ secrets.GITHUB_TOKEN }}
125+ - name : Build and push zot-exporter container image
126+ uses : project-stacker/stacker-build-push-action@main
130127 with :
128+ file : ' stacker-zxp.yaml'
131129 build-args : |
132130 COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
133131 OS=${{ matrix.os }}
134132 ARCH=${{ matrix.arch }}
135- push : true
136- file : Dockerfile-zxp
137- tags : |
138- ghcr.io/ ${{ github.repository }}-zxp-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}
139- ghcr.io/ ${{ github.repository }}-zxp-${{ matrix.os }}-${{ matrix.arch }}:latest
140- - name : Build zb container image
141- uses : docker/ build-push-action@v2
133+ REPO_NAME=zxp-${{ matrix.os }}-${{ matrix.arch }}
134+ url : docker://ghcr.io/${{ github.repository_owner }}
135+ tags : ${{ github.event.release.tag_name }} latest
136+ username : ${{ github.actor }}
137+ password : ${{ secrets.GITHUB_TOKEN }}
138+ - name : Build and push zb container image
139+ uses : project-stacker/stacker- build-push-action@main
142140 with :
141+ file : ' stacker-zb.yaml'
143142 build-args : |
144143 COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
145144 OS=${{ matrix.os }}
146145 ARCH=${{ matrix.arch }}
147- push : true
148- file : Dockerfile-zb
149- tags : |
150- ghcr.io/ ${{ github.repository }}-zb-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}
151- ghcr.io/ ${{ github.repository }}-zb-${{ matrix.os }}-${{ matrix.arch }}:latest
146+ REPO_NAME=zb-${{ matrix.os }}-${{ matrix.arch }}
147+ url : docker://ghcr.io/${{ github.repository_owner }}
148+ tags : ${{ github.event.release.tag_name }} latest
149+ username : ${{ github.actor }}
150+ password : ${{ secrets.GITHUB_TOKEN }}
152151 - name : Run Trivy vulnerability scanner
153152 uses : aquasecurity/trivy-action@master
154153 with :
155154 image-ref : ' ghcr.io/${{ github.repository }}-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}'
156155 format : ' sarif'
157156 output : ' trivy-results.sarif'
157+ env :
158+ TRIVY_USERNAME : ${{ github.actor }}
159+ TRIVY_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
158160 - name : Run Trivy vulnerability scanner (minimal)
159161 uses : aquasecurity/trivy-action@master
160162 with :
161163 image-ref : ' ghcr.io/${{ github.repository }}-minimal-${{ matrix.os }}-${{ matrix.arch }}:${{ github.event.release.tag_name }}'
162164 format : ' sarif'
163165 output : ' trivy-results.sarif'
166+ env :
167+ TRIVY_USERNAME : ${{ github.actor }}
168+ TRIVY_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
164169 - name : Upload Trivy scan results to GitHub Security tab
165170 uses : github/codeql-action/upload-sarif@v1
166171 with :
0 commit comments