Skip to content

Commit

Permalink
Added build on github registry
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
  • Loading branch information
rbrtbnfgl committed Jan 31, 2025
1 parent 2da93f2 commit ed95d6d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
env:
GO_VERSION: "1.23.3"
REPOSITORY: flannel/flannel-cni-plugin
IMAGE_NAME: flannel-io/flannel-cni-plugin
REGISTRY: ghcr.io

jobs:
build-and-release:
Expand Down Expand Up @@ -93,3 +95,53 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64
tags: ${{ steps.meta.outputs.tags }}

build-and-push-images-github-registry:
needs: [build-and-release]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.image
push: true
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: REGISTRY=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit ed95d6d

Please sign in to comment.