feat: create initial action implementation #11
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
test-single-format: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Sample Image | |
working-directory: test | |
run: podman build -t sample-image:local . | |
- name: Push (Single) | |
uses: ./ | |
id: push | |
with: | |
local-image-ref: sample-image:local | |
image: sample-image | |
manifest-tags: ${{ github.sha }}-${{ github.run_number }} | |
registry: ghcr.io/${{ github.repository }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Inspect Image Manifest | |
env: | |
MANIFEST_TAG: ${{ github.sha }}-${{ github.run_number }} | |
REGISTRY: ghcr.io/${{ github.repository }} | |
IMAGE: sample-image | |
DIGEST: ${{ steps.push.outputs.digest }} | |
run: | | |
MANIFEST=$(skopeo inspect docker://${REGISTRY}/${IMAGE}:${MANIFEST_TAG} | jq .) | |
echo "Manifest: $MANIFEST" | |
if [[ $(echo $MANIFEST | jq -r .Digest) != $DIGEST ]]; then | |
echo "Digest mismatch - expected $DIGEST, got $(echo $MANIFEST | jq -r .Digest)" | |
exit 1 | |
fi | |
- name: Inspect Image Raw Manifest | |
env: | |
MANIFEST_TAG: ${{ github.sha }}-${{ github.run_number }} | |
REGISTRY: ghcr.io/${{ github.repository }} | |
IMAGE: sample-image | |
DIGEST: ${{ steps.push.outputs.digest }} | |
run: | | |
RAW_MANIFEST=$(skopeo inspect --raw docker://${REGISTRY}/${IMAGE}:${MANIFEST_TAG} | jq -r .) | |
echo "Raw Manifest: $RAW_MANIFEST" | |
test-multi-format: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Sample Image | |
working-directory: test | |
run: podman build -t sample-image:local . | |
- name: Push (Multiple) | |
uses: ./ | |
id: push | |
with: | |
local-image-ref: sample-image:local | |
image: sample-image | |
manifest-tags: ${{ github.sha }}-${{ github.run_number }} | |
registry: ghcr.io/${{ github.repository }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
compression-formats: gzip zstd:chunked |