|
@@ -27,9 +27,10 @@ jobs:
|
|
|
permissions:
|
|
permissions:
|
|
|
packages: write
|
|
packages: write
|
|
|
contents: read
|
|
contents: read
|
|
|
|
|
+ id-token: write
|
|
|
steps:
|
|
steps:
|
|
|
- name: Check out (shallow)
|
|
- name: Check out (shallow)
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
+ uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
with:
|
|
with:
|
|
|
fetch-depth: 1
|
|
fetch-depth: 1
|
|
|
|
|
|
|
@@ -46,16 +47,16 @@ jobs:
|
|
|
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
|
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
- name: Set up Docker Buildx
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
+ uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
- name: Log in to Docker Hub
|
|
|
- uses: docker/login-action@v3
|
|
|
|
|
|
|
+ uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
|
with:
|
|
with:
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Log in to GHCR
|
|
- name: Log in to GHCR
|
|
|
- uses: docker/login-action@v3
|
|
|
|
|
|
|
+ uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
|
with:
|
|
with:
|
|
|
registry: ghcr.io
|
|
registry: ghcr.io
|
|
|
username: ${{ github.actor }}
|
|
username: ${{ github.actor }}
|
|
@@ -63,14 +64,15 @@ jobs:
|
|
|
|
|
|
|
|
- name: Extract metadata (labels)
|
|
- name: Extract metadata (labels)
|
|
|
id: meta
|
|
id: meta
|
|
|
- uses: docker/metadata-action@v5
|
|
|
|
|
|
|
+ uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
|
|
|
with:
|
|
with:
|
|
|
images: |
|
|
images: |
|
|
|
calciumion/new-api
|
|
calciumion/new-api
|
|
|
ghcr.io/${{ env.GHCR_REPOSITORY }}
|
|
ghcr.io/${{ env.GHCR_REPOSITORY }}
|
|
|
|
|
|
|
|
- name: Build & push single-arch (to both registries)
|
|
- name: Build & push single-arch (to both registries)
|
|
|
- uses: docker/build-push-action@v6
|
|
|
|
|
|
|
+ id: build
|
|
|
|
|
+ uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
|
|
|
with:
|
|
with:
|
|
|
context: .
|
|
context: .
|
|
|
platforms: ${{ matrix.platform }}
|
|
platforms: ${{ matrix.platform }}
|
|
@@ -83,8 +85,25 @@ jobs:
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
cache-from: type=gha
|
|
cache-from: type=gha
|
|
|
cache-to: type=gha,mode=max
|
|
cache-to: type=gha,mode=max
|
|
|
- provenance: false
|
|
|
|
|
- sbom: false
|
|
|
|
|
|
|
+ provenance: mode=max
|
|
|
|
|
+ sbom: true
|
|
|
|
|
+
|
|
|
|
|
+ - name: Install cosign
|
|
|
|
|
+ uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3
|
|
|
|
|
+
|
|
|
|
|
+ - name: Sign image with cosign
|
|
|
|
|
+ run: |
|
|
|
|
|
+ cosign sign --yes calciumion/new-api@${{ steps.build.outputs.digest }}
|
|
|
|
|
+ cosign sign --yes ghcr.io/${{ env.GHCR_REPOSITORY }}@${{ steps.build.outputs.digest }}
|
|
|
|
|
+
|
|
|
|
|
+ - name: Output digest
|
|
|
|
|
+ run: |
|
|
|
|
|
+ echo "### Docker Image Digest (${{ matrix.arch }})" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo '```' >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo "calciumion/new-api:alpha-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo "ghcr.io/${{ env.GHCR_REPOSITORY }}:alpha-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo "${{ steps.build.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo '```' >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
|
|
|
create_manifests:
|
|
create_manifests:
|
|
|
name: Create multi-arch manifests (Docker Hub + GHCR)
|
|
name: Create multi-arch manifests (Docker Hub + GHCR)
|
|
@@ -95,7 +114,7 @@ jobs:
|
|
|
contents: read
|
|
contents: read
|
|
|
steps:
|
|
steps:
|
|
|
- name: Check out (shallow)
|
|
- name: Check out (shallow)
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
+ uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
|
with:
|
|
with:
|
|
|
fetch-depth: 1
|
|
fetch-depth: 1
|
|
|
|
|
|
|
@@ -110,7 +129,7 @@ jobs:
|
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
- name: Log in to Docker Hub
|
|
|
- uses: docker/login-action@v3
|
|
|
|
|
|
|
+ uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
|
with:
|
|
with:
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
@@ -130,7 +149,7 @@ jobs:
|
|
|
calciumion/new-api:${VERSION}-arm64
|
|
calciumion/new-api:${VERSION}-arm64
|
|
|
|
|
|
|
|
- name: Log in to GHCR
|
|
- name: Log in to GHCR
|
|
|
- uses: docker/login-action@v3
|
|
|
|
|
|
|
+ uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
|
with:
|
|
with:
|
|
|
registry: ghcr.io
|
|
registry: ghcr.io
|
|
|
username: ${{ github.actor }}
|
|
username: ${{ github.actor }}
|
|
@@ -149,3 +168,12 @@ jobs:
|
|
|
-t ghcr.io/${GHCR_REPOSITORY}:${VERSION} \
|
|
-t ghcr.io/${GHCR_REPOSITORY}:${VERSION} \
|
|
|
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-amd64 \
|
|
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-amd64 \
|
|
|
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-arm64
|
|
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-arm64
|
|
|
|
|
+
|
|
|
|
|
+ - name: Output manifest digest
|
|
|
|
|
+ run: |
|
|
|
|
|
+ echo "### Multi-arch Manifest Digests" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo '```' >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ docker buildx imagetools inspect calciumion/new-api:alpha >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo "---" >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ docker buildx imagetools inspect ghcr.io/${GHCR_REPOSITORY}:alpha >> $GITHUB_STEP_SUMMARY
|
|
|
|
|
+ echo '```' >> $GITHUB_STEP_SUMMARY
|