Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKERHUB_IMAGE: docker.io/getclustered/garage-storage-controller
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

permissions:
contents: write
Expand Down Expand Up @@ -72,6 +74,27 @@ jobs:
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}

- name: Log in to Docker Hub
if: env.DOCKERHUB_USERNAME != ''
uses: docker/login-action@v4
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image to Docker Hub mirror
if: env.DOCKERHUB_USERNAME != ''
run: |
docker buildx imagetools create \
-t ${{ env.DOCKERHUB_IMAGE }}:${{ steps.version.outputs.VERSION }} \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}

- name: Push latest to Docker Hub
if: github.ref_type == 'tag' && env.DOCKERHUB_USERNAME != ''
run: |
docker buildx imagetools create \
-t ${{ env.DOCKERHUB_IMAGE }}:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}

- name: Package CRDs
if: github.ref_type == 'tag'
run: kubectl kustomize ./config/install/crds -o crds-${{ steps.version.outputs.VERSION }}.yaml
Expand All @@ -87,6 +110,7 @@ jobs:
body: |

Controller image: `${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}`
(mirror at `${{ env.DOCKERHUB_IMAGE }}`)

## Changes

Expand Down
Loading