Skip to content

Instantly share code, notes, and snippets.

@nmagee
Created September 16, 2022 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmagee/e33c6eb7a5d0ba1eab31ff0de4babae5 to your computer and use it in GitHub Desktop.
Save nmagee/e33c6eb7a5d0ba1eab31ff0de4babae5 to your computer and use it in GitHub Desktop.
A template snippet for GitHub action that is triggered by a source deployment. This updates a K8S deployment for handling by ArgoCD
name: Remote Dispatch Action
on: [ repository_dispatch, workflow_dispatch ]
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Event Information
run: |
echo "Event '${{ github.event.action }}' received. Increase ${{ github.event.client_payload.service }} service to version ${{ github.event.client_payload.version }}."
- name: Update Image Version in the related HelmChart values.yaml
uses: fjogeleit/yaml-update-action@main
with:
valueFile: '<PATH-TO>/values.yaml'
propertyPath: '.version.${{ github.event.client_payload.service }}'
value: ${{ github.event.client_payload.version }}
branch: main
targetBranch: main
createPR: false
message: 'Update ${{ github.event.client_payload.service }} to ${{ github.event.client_payload.version }}'
@nmagee
Copy link
Author

nmagee commented Sep 16, 2022

This trigger works as the receiving end of a two-repo GHA flow.

This is triggered by a source action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment