ci: bump image version in workflow #10
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: Build and push docker image | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| actions: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get commit sha | |
| run: | | |
| COMMIT_SHA=$(git rev-parse --short $GITHUB_SHA) | |
| echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV | |
| - name: Set up docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ env.COMMIT_SHA }} | |
| - name: Setup kube tools | |
| uses: yokawasa/action-setup-kube-tools@v0.11.1 | |
| with: | |
| setup-tools: | | |
| kustomize | |
| kustomize: "5.4.3" | |
| - name: Initialize mandatory git config | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email noreply@github.com | |
| - name: Bump frontend image tag | |
| run: | | |
| cd ./deploy/kustomize | |
| kustomize edit set image plugin-image=ghcr.io/green-ecolution/tbz-baumkataster-plugin:${{ env.COMMIT_SHA }} | |
| - name: Commit changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GREEN_ECOLUTION_PAT }} | |
| run: | | |
| git add deploy/kustomize/kustomization.yaml | |
| git commit -m "chore: update submodules and dump image tag to ${{ env.COMMIT_SHA }}" && git push origin develop || echo "No changes to commit" |