Skip to content

Update [push]

Update [push] #476

Workflow file for this run

name: Update image tags and Helm versions
run-name: Update ${{ github.event.inputs.image != 0 && format('Docker image {0} ({1})', github.event.inputs.image, github.event.inputs.tag) || github.event.inputs.chart != 0 && format('Helm chart {0} ({1})', github.event.inputs.chart, github.event.inputs.tag) || format('[{0}]', github.event_name) }}
on:
workflow_dispatch:
inputs:
image:
description: Published Docker image
chart:
description: Published Helm chart
tag:
description: Updated tag/version
upstream:
description: Upstream job URL
push:
branches:
- main
paths:
- updatecli.d/*
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
pull-requests: write
jobs:
updatecli:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install updatecli
uses: updatecli/updatecli-action@v2
- name: Update image tags
run: |
echo "# Continuous Deployment" > update.log
echo "Updating Docker image tags and Helm versions:" >> update.log
updatecli apply |& tee >(grep -Eo '[^._]*(\.image\.tag|_chart_version)" updated from .*,' | sed -e 's/[",]//g;s/^/- /' >> update.log)
if [ ! -z "${{ github.event.inputs.upstream }}" ] ; then
echo "---" >> update.log
echo "Triggered by: ${{ github.event.inputs.upstream }}" >> update.log
fi
- name: Create pull request
id: create_pr
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update ${{ github.event.inputs.image != 0 && format('Docker image {0} ({1})', github.event.inputs.image, github.event.inputs.tag) || github.event.inputs.chart != 0 && format('Helm chart {0} ({1})', github.event.inputs.chart, github.event.inputs.tag) || format('[{0}]', github.event_name) }}
title: Update ${{ github.event.inputs.image != 0 && format('Docker image {0} ({1})', github.event.inputs.image, github.event.inputs.tag) || github.event.inputs.chart != 0 && format('Helm chart {0} ({1})', github.event.inputs.chart, github.event.inputs.tag) || format('[{0}]', github.event_name) }}
body-path: update.log
delete-branch: true
- name: Auto merge pull request
if: steps.create_pr.outputs.pull-request-number && github.event_name != 'push'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
merge-method: squash
token: ${{ secrets.MERGE_TOKEN }}