Revert image value to latest for the main branch #4
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
name: Release Godaddy Webhook Helm Chart | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: contains(github.event.head_commit.message, '[to_release]') | |
permissions: | |
contents: write # for creating Releases .tgz (403 from chart-releaser-action if not set) | |
#pages: write # not required for chart-releaser-action | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
- # This action gets the latest tag version and increment it | |
# using semver as documented: https://github.com/reecetech/version-increment/tree/main | |
name: Get next version | |
uses: reecetech/version-increment@2023.9.3 | |
id: next-version | |
with: | |
scheme: semver | |
increment: minor | |
- name: Tag chart and image | |
run: | | |
export NEW_VERSION="${{ steps.next-version.outputs.version }}" | |
echo "New version: $NEW_VERSION" | |
yq '.appVersion = env(NEW_VERSION)' -i ./deploy/charts/godaddy-webhook/Chart.yaml | |
yq '.image.tag = env(NEW_VERSION)' -i ./deploy/charts/godaddy-webhook/values.yaml | |
git config user.email "github-actions@github.com" | |
git config user.name "GitHub Actions" | |
git add ./deploy/charts/godaddy-webhook/Chart.yaml | |
git add ./deploy/charts/godaddy-webhook/values.yaml | |
git commit -m "Update Helm chart version to $NEW_VERSION" | |
git push | |
- name: Login to Quay.io Hub | |
uses: docker/login-action@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_ROBOT_USER }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Build the container image | |
run: | | |
NEW_VERSION="${{ steps.next-version.outputs.version }}" | |
docker build -t cert-manager-webhook-godaddy:${NEW_VERSION} -f Dockerfile . | |
TAG_ID=$(docker images -q cert-manager-webhook-godaddy:${NEW_VERSION}) | |
docker tag ${TAG_ID} quay.io/snowdrop/cert-manager-webhook-godaddy:${NEW_VERSION} | |
docker push quay.io/snowdrop/cert-manager-webhook-godaddy:${NEW_VERSION} | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.5.0 | |
with: | |
charts_dir: deploy/charts | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |