-
Notifications
You must be signed in to change notification settings - Fork 12
ISSUE-114: Separate OKD build and push phases #126
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,57 @@ | ||
| name: cleanup-okd-staging | ||
| description: Cleanup staging OKD images from the container registry | ||
|
|
||
| inputs: | ||
| okd-version-tag: | ||
| description: OKD version tag from https://quay.io/repository/okd/scos-release?tab=tags | ||
| required: true | ||
| token: | ||
| description: Token for the GitHub Container Registry | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Cleanup staging registry | ||
| shell: bash | ||
| continue-on-error: true | ||
| env: | ||
| GH_TOKEN: ${{ inputs.token }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # GitHub Container Registry cleanup using gh CLI | ||
| # Deletes known staging packages | ||
| echo "Cleaning up staging packages..." | ||
|
|
||
| OWNER="${{ github.repository_owner }}" | ||
|
|
||
| # Detect if owner is an organization or user account | ||
| if gh api "/orgs/${OWNER}" --silent 2>/dev/null; then | ||
| OWNER_TYPE="orgs" | ||
| echo "Detected organization: ${OWNER}" | ||
| else | ||
| OWNER_TYPE="users" | ||
| echo "Detected user account: ${OWNER}" | ||
| fi | ||
|
|
||
| # Get list of staging packages from the build script | ||
| cd "${GITHUB_WORKSPACE}" | ||
| mapfile -t packages < <(./src/okd/build_images.sh list-packages "${{ inputs.okd-version-tag }}") | ||
|
|
||
| # Delete each package | ||
| for package in "${packages[@]}"; do | ||
| # URL-encode package name (replace / with %2F) | ||
| encoded_package="${package//\//%2F}" | ||
|
|
||
| echo "Deleting package: ${package}" | ||
| # Use appropriate endpoint based on owner type | ||
| if gh api --method DELETE "/${OWNER_TYPE}/${OWNER}/packages/container/${encoded_package}" \ | ||
| -H "Accept: application/vnd.github+json" 2>&1; then | ||
| echo " ✓ Deleted successfully" | ||
| else | ||
| echo " ⚠ Failed to delete (may not exist or already deleted)" | ||
| fi | ||
| done | ||
|
|
||
| echo "Staging registry cleanup completed" |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.