Skip to content

Upgrade docker image in chart if needed #271

Upgrade docker image in chart if needed

Upgrade docker image in chart if needed #271

name: Upgrade docker image in chart if needed
defaults:
run:
# GitHub Actions run without a TTY device. This is a workaround to get one,
# based on https://github.com/actions/runner/issues/241#issuecomment-842566950.
shell: 'script -O /dev/stdout -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
on:
schedule:
- cron: "0 1 * * *"
jobs:
build:
name: Check grist_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: grist_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: gristlabs/grist-core
- name: Format version
id: version
run: |
version=$(echo ${{ steps.grist_release.outputs.release }} | awk -F'v' '{print $2}')
if ! grep ' tag: "'"${version}"'"' charts/grist/values.yaml; then
sed -i '22s/ tag: .*/ tag: "'"${version}"'"/' charts/grist/values.yaml
cd charts/grist
./update_readme.sh
. ../../scripts/utils.sh
chart_version=$(cat Chart.yaml |awk '/version:/ {print $2}')
app_version=$(cat Chart.yaml |awk '/appVersion:/ {print $2}')
new_chart_version=$(increment_version $chart_version)
new_app_version=$(increment_version $app_version)
sed -i "s/${chart_version}/${new_chart_version}/g" Chart.yaml
sed -i "s/${app_version}/${new_app_version}/g" Chart.yaml
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "[GRIST] Automatic upgrade version"
title: "[GRIST] Automatic upgrade version"