Skip to content

argocd

argocd #447

Workflow file for this run

name: Repository Dispatch
on:
repository_dispatch:
types:
- argocd
- argocd-manual
permissions:
contents: write
jobs:
build:
name: Set ${{ github.event.client_payload.repository }} deployment image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update image version
if: github.event.client_payload.environment != ''
uses: mikefarah/[email protected]
with:
cmd: yq -i '.spec.template.spec.containers[0].image = "${{ github.event.client_payload.image }}"' ${{ github.event.client_payload.repository }}/${{ github.event.client_payload.environment }}/deployment.yaml
- name: Update image version
if: github.event.client_payload.environment == '' && github.event.client_payload.ref == 'develop'
uses: mikefarah/[email protected]
with:
cmd: yq -i '.spec.template.spec.containers[0].image = "${{ github.event.client_payload.image }}"' ${{ github.event.client_payload.repository }}/dev/deployment.yaml
- name: Update image version
if: github.event.client_payload.environment == '' && github.event.client_payload.ref == 'release'
uses: mikefarah/[email protected]
with:
cmd: yq -i '.spec.template.spec.containers[0].image = "${{ github.event.client_payload.image }}"' ${{ github.event.client_payload.repository }}/stage/deployment.yaml
- name: Set commit message
uses: stefanzweifel/git-auto-commit-action@v5
if: github.event.client_payload.environment == ''
with:
commit_message: "${{ format('[{0}]: {1}', github.event.client_payload.ref, github.event.client_payload.commit_msg) }}"
- name: Set commit message
uses: stefanzweifel/git-auto-commit-action@v5
if: github.event.client_payload.environment != ''
with:
commit_message: "${{ format('[{0}]: Manual deployment triggered by @{1}', github.event.client_payload.ref, github.event.client_payload.actor) }}"