Skip to content

Commit

Permalink
Merge pull request #342 from fluxcd/prerelease-workflow
Browse files Browse the repository at this point in the history
Publish on-demand RC container images
  • Loading branch information
stefanprodan authored May 11, 2021
2 parents 9061419 + 598c34e commit 185ba32
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'image tag prefix'
default: 'rc'
required: true

env:
CONTROLLER: ${{ github.event.repository.name }}
Expand All @@ -17,7 +23,7 @@ jobs:
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
Expand Down Expand Up @@ -68,11 +74,13 @@ jobs:
docker pull docker.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
docker pull ghcr.io/fluxcd/${{ env.CONTROLLER }}:${{ steps.prep.outputs.VERSION }}
- name: Generate release manifests
if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir -p config/release
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
prerelease: true
Expand Down

0 comments on commit 185ba32

Please sign in to comment.