update-manifest #423
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Update Manifest | |
on: | |
repository_dispatch: | |
types: [update-manifest] | |
jobs: | |
update-manifest: | |
name: Update ${{ github.event.client_payload.repository }} Manifest | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@main | |
- name: Extract repository and owner in seperate vars | |
run: | | |
owner=$(echo ${{ github.event.client_payload.repository }} | cut -d'/' -f1) | |
repo=$(echo ${{ github.event.client_payload.repository }} | cut -d'/' -f2) | |
echo "REPO_NAME=$repo" >> $GITHUB_ENV | |
echo "REPO_OWNER=$owner" >> $GITHUB_ENV | |
- uses: alexellis/arkade-get@master | |
with: | |
kubectl: latest | |
- name: Print kubectl & kustomize versions | |
run: | | |
kubectl version --client | |
- name: Replace image tag | |
run: |- | |
cd ./manifests/${{env.REPO_NAME}}/overlay | |
kustomize edit set image ${{ github.event.client_payload.registry }}/${{ github.event.client_payload.repository }}:${{ github.event.client_payload.sha }} | |
- name: Show K8s manifest | |
run: | | |
cd ./manifests/${{env.REPO_NAME}}/overlay | |
kubectl kustomize . | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: | |
"Update ${{env.REPO_NAME}}, bump image version" |