Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push-tag.yml - notify Humanitec's artefact-versions #53

Merged
merged 3 commits into from
Jul 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/push-tag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# You need to set up Workload Identity Federation in your Google Cloud project in order to use this GitHub Actions definition: https://medium.com/p/3932dce678b8.
# And the secrets.GSA_ID needs to have the roles/artifactregistry.writer role in order push container images.
name: push-tag
permissions:
contents: read
Expand Down Expand Up @@ -94,6 +95,18 @@ jobs:
echo "IMAGE_DIGEST=$(oras manifest fetch ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
--descriptor \
| jq -r .digest)" >> $GITHUB_ENV
- name: notify humanitec with new container image
run: |-
.github/workflows/bin/humctl api POST /orgs/${{ secrets.HUMANITEC_ORG }}/artefact-versions \
--token ${{ secrets.HUMANITEC_TOKEN }} \
-d '{
"name": "'${{ env.IMAGE_NAME }}'",
"version": "'${{ env.IMAGE_TAG }}'",
"digest": "'${IMAGE_DIGEST}'",
"type": "container",
"commit": "'$(echo ${GITHUB_SHA} | cut -c1-7)'",
"ref": "'${GITHUB_REF}'"
}'
- name: deploy score-humanitec
run: |
sed -i "s,image: ${{ vars.APP_NAME }},image: ${{ env.IMAGE_NAME }}@${IMAGE_DIGEST},g" score/score.yaml
Expand Down