Skip to content

Commit

Permalink
cicd: use common expiration action
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Nov 1, 2021
1 parent bfc1abd commit f185a9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
is_prerelease: ${{ startsWith(github.ref, 'refs/tags/') && (contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }}
image_tag: ${{ steps.setup.outputs.image_tag }}
image_repo: ${{ steps.setup.outputs.image_repo }}
expiration: ${{ steps.setup.outputs.expiration }}
build_image: ${{ steps.setup.outputs.build_image }}
build_go_version: ${{ steps.setup.outputs.build_go_version }}
build_cache_key: ${{ steps.go.outputs.cache_key }}
Expand All @@ -36,7 +35,6 @@ jobs:
printf '::set-output name=tar_prefix::%s\n' "clair-${tag}"
printf '::set-output name=image_tag::%s\n' "${tag#v}"
printf '::set-output name=image_repo::%s\n' "${REPO}"
printf '::set-output name=expiration::%s\n' "$(($(date -u '+%s') + 1209600))"
printf '::set-output name=build_image::%s\n' "${BUILD_IMAGE}"
printf '::set-output name=build_go_version::%s\n' "${BUILD_IMAGE##*:}"
- name: Check go version
Expand Down Expand Up @@ -215,6 +213,13 @@ jobs:
push: true
tags: |
quay.io/${{ needs.config.outputs.image_repo }}:${{ needs.config.outputs.image_tag }}
- name: Set Expiration
if: needs.config.outputs.is_prerelease
uses: ./.github/actions/set-image-expiration
with:
repo: ${{ needs.config.outputs.image_repo }}
tag: ${{ needs.config.outputs.image_tag }}
token: ${{ secrets.QUAY_API_TOKEN }}

deploy-documentation:
name: Deploy Documentation
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,8 @@ jobs:
quay.io/${{ steps.setup.outputs.repo }}:${{ steps.setup.outputs.tag }}-${{ steps.setup.outputs.date }}
- name: Set Expiration
if: steps.setup.outputs.push && steps.setup.outputs.api
run: |
curl --config - <<.
silent
show-error
fail-with-body
data-raw=$(jq -n '{expiration: ${{ steps.setup.outputs.expiration }}}|tostring')
header="Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}"
header="Content-Type: application/json"
header="Accept: application/json"
request=PUT
url="https://quay.io/api/v1/repository/${{ steps.setup.outputs.repo }}/tag/${{ steps.setup.outputs.tag }}-${{ steps.setup.outputs.date }}"
.
uses: ./.github/actions/set-image-expiration
with:
repo: ${{ steps.setup.outputs.repo }}
tag: ${{ steps.setup.outputs.tag }}-${{ steps.setup.outputs.date }}
token: ${{ secrets.QUAY_API_TOKEN }}

0 comments on commit f185a9b

Please sign in to comment.