forked from KWasm/kwasm-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
14 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 |
---|---|---|
|
@@ -27,15 +27,32 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
- # Set up QEMU | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
- # Setup Docker buildx | ||
name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Log in to the Container registry | ||
uses: docker/setup-buildx-action@v2 | ||
- # Build the local image | ||
name: Build Local Container | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
tags: "local/${{ inputs.image-name }}:${{ inputs.image-tag }}" | ||
push: false | ||
load: true | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- # Install cosign | ||
name: Install Cosign | ||
uses: sigstore/[email protected] | ||
with: | ||
cosign-release: v2.0.0 | ||
- # Login into registry | ||
name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
|
@@ -53,24 +70,20 @@ jobs: | |
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=sha | ||
- | ||
name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- | ||
name: Install Cosign for signing Spin binary | ||
uses: sigstore/[email protected] | ||
with: | ||
cosign-release: v2.0.0 | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
${{ steps.meta.outputs.tags }} | ||
- | ||
name: Sign the image with GitHub OIDC token | ||
shell: bash | ||
|
@@ -79,7 +92,7 @@ jobs: | |
--yes \ | ||
--output-certificate crt.pem \ | ||
--output-signature kwasm-image.sig \ | ||
${{ steps.meta.outputs.tags }} | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
- | ||
name: prepare assets for upload | ||
if: runner.os != 'Windows' | ||
|