-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consolidate push by digest/create digest artifact steps into action
- Loading branch information
1 parent
ca16d5d
commit 3e67ea0
Showing
2 changed files
with
156 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 'Push Container by Digest Action' | ||
description: 'Pushes an image by digest to a given registry, then outputs its digest and tags as an artifact' | ||
|
||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- id: slash-escape | ||
run: | | ||
platform=${{ inputs.platform }} | ||
echo "platform=${platform//\//-}" >> ${GITHUB_OUTPUT} | ||
- name: Registry login | ||
# if: >- | ||
# github.ref == 'refs/heads/master' && | ||
# github.event_name != 'pull_request' && | ||
# github.repository_owner == 'opensciencegrid' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ inputs.registry }} | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
|
||
- id: upload-image | ||
uses: ./.github/actions/build-container-local | ||
with: | ||
registry_url: ${{ inputs.registry }} | ||
osg_series: ${{ inputs.osg_series }} | ||
osg_repo: ${{ inputs.repo }} | ||
base_os: ${{ inputs.os }} | ||
platform: ${{ inputs.platform }} | ||
push_by_digest: true | ||
timestamp_image: ${{ inputs.timestamp_image }} | ||
setup: false | ||
output_image: ${{ inputs.output_image }} | ||
|
||
- name: Export digest | ||
run: | | ||
mkdir -p /tmp/digests | ||
digest="${{ steps.upload-image.outputs.digest }}" | ||
touch "/tmp/digests/${digest#sha256:}" | ||
- name: Upload digest | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: digests-${{ inputs.base_tag }}-${{ steps.slash-escape.outputs.platform }} | ||
path: /tmp/digests/* | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
- name: Export tags | ||
run: | | ||
mkdir -p /tmp/tags | ||
echo ${{ steps.upload-image.outputs.image-list }} > /tmp/tags/${{ inputs.base_tag }}-${{ steps.slash-escape.outputs.platform }} | ||
- name: Upload tags | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tags-${{ inputs.base_tag }}-${{ steps.slash-escape.outputs.platform }} | ||
path: /tmp/tags/* | ||
if-no-files-found: error | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters