Promote to prod #1
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: Promote to prod | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| promote: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Copy dev tag to prod | |
| run: | | |
| DEV_TAG=$(grep -A1 "name: image.tag" manifests/argocd/app-dev.yaml | grep value | awk '{print $2}' | tr -d '"') | |
| sed -i "/name: image.tag/{n;s|value:.*|value: \"$DEV_TAG\"|}" manifests/argocd/app-prod.yaml | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add manifests/argocd/app-prod.yaml | |
| git commit -m "ci: promote $DEV_TAG to prod" | |
| git push |