Skip to content

app_delivery

app_delivery #112

name: Production Stage
on:
repository_dispatch:
types: [app_delivery]
jobs:
update:
name: Update application version
runs-on: ubuntu-22.04
permissions:
contents: write
env:
APP_IMAGE: ${{ github.event.client_payload.app_image }}
APP_NAME: ${{ github.event.client_payload.app_name }}
APP_VERSION: ${{ github.event.client_payload.app_version }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Update image version
run: |
cd \
kubernetes/applications/${{ env.APP_NAME }}/production
kustomize edit set image \
${{ env.APP_IMAGE }}=${{ env.APP_IMAGE }}:${{ env.APP_VERSION }}
sed -i 's/ref=[a-fA-F0-9]\{40\}/ref=${{ env.APP_VERSION }}/' \
kustomization.yml
- name: Commit updated manifests
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update ${{ env.APP_NAME }} to version ${{ env.APP_VERSION }}"
branch: main