Skip to content

Commit

Permalink
Indicate released image in the release body
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <[email protected]>
  • Loading branch information
kron4eg committed Sep 18, 2024
1 parent 2e58100 commit 1bd8eab
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 8 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push a release image
name: Build, push and release
on:
workflow_dispatch:
inputs:
Expand All @@ -11,8 +11,18 @@ on:
required: true
type: string

env:
IMAGE_REGISTRY: ghcr.io
IMAGE_REPO: gardener/ingress-gce
IMAGE_TAG: ${{ inputs.release_tag }}
PLATFORMS: linux/amd64,linux/arm64

defaults:
run:
shell: bash

jobs:
build-push:
build-push-release:
permissions:
# give GITHUB_TOKEN write permissions
packages: write
Expand All @@ -34,25 +44,29 @@ jobs:
- name: Login to registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # https://github.com/docker/login-action/releases/tag/v3.3.0
with:
registry: ghcr.io
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker setup buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # https://github.com/docker/setup-buildx-action/releases/tag/v3.6.1
with:
platforms: linux/amd64,linux/arm64
platforms: ${{ env.PLATFORMS }}

- name: Build and push Docker images
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # https://github.com/docker/build-push-action/releases/tag/v6.7.0
with:
context: .
tags: |
ghcr.io/gardener/ingress-gce:${{ inputs.release_tag }}
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }}
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.PLATFORMS }}

- name: Create new release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # https://github.com/ncipollo/release-action/releases/tag/v1.14.0
with:
tag: ${{ inputs.release_tag }}
makeLatest: true
body: |
## Docker Images
* ingress-gce: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_REPO }}:${{ env.IMAGE_TAG }}
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

[![reuse compliant](https://reuse.software/badge/reuse-compliant.svg)](https://reuse.software/)

This repository is dedicated to building [kubernetes/ingress-gce](https://github.com/kubernetes/ingress-gce) images for Gardener project.

## Building a new Release

Once in a while a new release of the
[kubernetes/ingress-gce](https://github.com/kubernetes/ingress-gce) will be
released and we need to build new docker image. In order to trigger the new
release one can use two options, tigger the release workflow from the web UI or
from CLI, see more at the
https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow.


### Trigger the release from the Github web UI

* Navigate to Actions https://github.com/gardener/ingress-gce/actions
* Select **Build, push and release** worflow
* Click **Run worflow** button
* Input `New release tag to publish` and `kubernetes/ingress-gce version to build`
* Click green **Run worflow** button

### Trigger the release from gh CLI

```shell
gh workflow run release.yaml -f release_tag=<NEW_TAG_TO_RELEASE> -f ingress_gce_version=<TAG_FROM_UPSTREAM>
```

Where `NEW_TAG_TO_RELEASE` is a new tag for the GH release and image to be
created and `TAG_FROM_UPSTREAM` is existing target tag to build from
[kubernetes/ingress-gce](https://github.com/kubernetes/ingress-gce).

Example:

```shell
gh workflow run release.yaml -f release_tag=v1.30.0-sap.0 -f ingress_gce_version=v1.30.0
```

Will build [kubernetes/ingress-gce](https://github.com/kubernetes/ingress-gce) binary from v1.30.0 git tag, and publish docker image: `ghcr.io/gardener/ingress-gce:v1.30.0-sap.0`


## How to use this repository template

This template repository can be used to seed new git repositories in the gardener github organisation.
Expand Down Expand Up @@ -99,5 +138,3 @@ In case you modify copied/forked source code you must state this in the header v
To get your project reuse compliant you should register it [here](https://api.reuse.software/register) using your SAP email address. After confirming your email, an inital reuse check is done by the reuse API.

To add the badge to your project's `README.md` file, use the snipped provided by the reuse API.

##

0 comments on commit 1bd8eab

Please sign in to comment.