.gitea/workflows/redhat_build.yml aktualisiert
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
```yaml
|
||||||
name: Build container image
|
name: Build container image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -145,6 +146,32 @@ jobs:
|
|||||||
|
|
||||||
outputs: type=oci,dest=${{ github.workspace }}/oci-layout.tar,tar=true
|
outputs: type=oci,dest=${{ github.workspace }}/oci-layout.tar,tar=true
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Inspect OCI archive
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
- name: Inspect OCI archive
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "OCI archive:"
|
||||||
|
ls -lh "${{ github.workspace }}/oci-layout.tar"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "OCI index.json:"
|
||||||
|
tar -xf "${{ github.workspace }}/oci-layout.tar" \
|
||||||
|
-O index.json | jq .
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "OCI image references:"
|
||||||
|
tar -xf "${{ github.workspace }}/oci-layout.tar" \
|
||||||
|
-O index.json \
|
||||||
|
| jq -r '
|
||||||
|
.manifests[]
|
||||||
|
| .annotations["org.opencontainers.image.ref.name"] // "(no ref.name)"
|
||||||
|
'
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Install Skopeo
|
# Install Skopeo
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
@@ -156,24 +183,34 @@ jobs:
|
|||||||
sudo apt-get install -y skopeo
|
sudo apt-get install -y skopeo
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Push image via Skopeo
|
# Push images via Skopeo
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
- name: Push Image via Skopeo (zstd:chunked)
|
- name: Push Images via Skopeo (zstd:chunked)
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
|
||||||
|
OCI_ARCHIVE="${{ github.workspace }}/oci-layout.tar"
|
||||||
TAGS="${{ steps.metadata.outputs.tags }}"
|
TAGS="${{ steps.metadata.outputs.tags }}"
|
||||||
|
|
||||||
for TAG in $TAGS; do
|
echo "Images to push:"
|
||||||
echo "Pushe ${TAG} via Skopeo mit zstd:chunked..."
|
echo "${TAGS}"
|
||||||
|
|
||||||
|
for DEST_TAG in ${TAGS}; do
|
||||||
|
SOURCE_TAG="${DEST_TAG##*:}"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "============================================================"
|
||||||
|
echo "Source OCI tag : ${SOURCE_TAG}"
|
||||||
|
echo "Destination : ${DEST_TAG}"
|
||||||
|
echo "============================================================"
|
||||||
|
|
||||||
skopeo copy \
|
skopeo copy \
|
||||||
--dest-creds "${{ github.repository_owner }}:${{ secrets.REGISTRY }}" \
|
--dest-creds "${{ github.repository_owner }}:${{ secrets.REGISTRY }}" \
|
||||||
--dest-compress-format zstd:chunked \
|
--dest-compress-format zstd:chunked \
|
||||||
"oci-archive:${{ github.workspace }}/oci-layout.tar" \
|
"oci-archive:${OCI_ARCHIVE}:${SOURCE_TAG}" \
|
||||||
"docker://${TAG}"
|
"docker://${DEST_TAG}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
@@ -204,7 +241,7 @@ jobs:
|
|||||||
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
|
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
|
||||||
COSIGN_PASSWORD: ""
|
COSIGN_PASSWORD: ""
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
|
||||||
echo "${{ secrets.REGISTRY }}" \
|
echo "${{ secrets.REGISTRY }}" \
|
||||||
| cosign login "${{ env.REGISTRY_HOST }}" \
|
| cosign login "${{ env.REGISTRY_HOST }}" \
|
||||||
@@ -247,3 +284,4 @@ jobs:
|
|||||||
rm -f "${{ github.workspace }}/oci-layout.tar"
|
rm -f "${{ github.workspace }}/oci-layout.tar"
|
||||||
|
|
||||||
docker buildx prune -a -f || true
|
docker buildx prune -a -f || true
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user