deploy-prod #21
This file contains hidden or 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: Deploy prod (GitOps) | |
| on: | |
| repository_dispatch: | |
| types: | |
| - deploy-prod | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout GitOps Repo | |
| uses: actions/checkout@v4 | |
| - name: Validate payload | |
| run: | | |
| echo "SERVICE=${{ github.event.client_payload.service }}" | |
| echo "IMAGE=${{ github.event.client_payload.image }}" | |
| echo "TAG=${{ github.event.client_payload.tag }}" | |
| - name: Update prod image tag | |
| run: | | |
| SERVICE=${{ github.event.client_payload.service }} | |
| cd prod/${SERVICE} | |
| kustomize edit set image \ | |
| REPLACE_IMAGE_${SERVICE^^}=${{ github.event.client_payload.image }}:${{ github.event.client_payload.tag }} | |
| - name: Commit and Push | |
| run: | | |
| git config user.name "eventee-prod-ci" | |
| git config user.email "ci@eventee.cloud" | |
| git commit -am "(chore/prod): deploy ${{ github.event.client_payload.service }} ${{ github.event.client_payload.tag }}" || echo "no changes" | |
| git push origin main |