Skip to content

Commit 49cca7c

Browse files
authored
add cli container image to release workflow (#333)
* add cli container image to release workflow Signed-off-by: Janine Olear <[email protected]> * pin release actions to commit hashes Signed-off-by: Janine Olear <[email protected]> --------- Signed-off-by: Janine Olear <[email protected]>
1 parent b02ed74 commit 49cca7c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,51 @@ jobs:
5555
path: dist/
5656
- uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
5757

58+
build_and_push_container:
59+
name: Build and Push Docker Image
60+
needs: [publish_release_to_pypi]
61+
runs-on: ubuntu-latest
62+
permissions:
63+
id-token: write
64+
attestations: write
65+
steps:
66+
- name: Checkout repository
67+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
68+
69+
- name: Build Image
70+
id: build_image
71+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
72+
with:
73+
containerfiles: |
74+
./Containerfile
75+
image: ghcr.io/sigstore/model-transparency-cli
76+
tags: latest
77+
archs: amd64
78+
oci: false
79+
80+
- id: docker_meta
81+
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
82+
with:
83+
images: ${{ steps.build_image.outputs.image }}
84+
tags: type=sha,format=long,type=ref,event=branch
85+
86+
- name: Login to GitHub Container Registry
87+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
88+
id: registry_login
89+
with:
90+
registry: ghcr.io
91+
username: ${{ github.actor }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
93+
94+
- name: Push To GHCR
95+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
96+
id: push
97+
with:
98+
image: ${{ steps.build_image.outputs.image }}
99+
tags: ${{ steps.build_image.outputs.tags }}
100+
registry: ghcr.io
101+
58102
# TODO: Create and publish release notes
59103
# TODO: Generate SLSA provenance for the wheels
60104
# TODO: Sign artifacts with sigstore and publish to release page
105+
# TODO: Build container cli for other platforms

0 commit comments

Comments
 (0)