Update git config and remote URL in kustomize-ci 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: Helm CI - Build and Update Values.yaml | |
| # on: | |
| # push: | |
| # branches: | |
| # - main | |
| # jobs: | |
| # build-and-push: | |
| # name: Build and Push Docker Image | |
| # runs-on: ubuntu-latest | |
| # outputs: | |
| # image-tag: ${{ steps.meta.outputs.image-tag }} | |
| # env: | |
| # IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Set up JDK 17 | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # distribution: 'temurin' | |
| # java-version: '17' | |
| # - name: Build Spring Boot App | |
| # working-directory: ./app | |
| # run: ./mvnw clean package -DskipTests | |
| # - name: Set up Docker Buildx | |
| # uses: docker/setup-buildx-action@v3 | |
| # - name: Login to DockerHub | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # - name: Build and Push Docker Image | |
| # id: meta | |
| # run: | | |
| # COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) | |
| # IMAGE_TAG="main-${COMMIT_SHA}" | |
| # echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV | |
| # echo "::set-output name=image-tag::$IMAGE_TAG" | |
| # docker build -t $IMAGE_NAME:$IMAGE_TAG ./app | |
| # docker push $IMAGE_NAME:$IMAGE_TAG | |
| # update-helm-values: | |
| # name: Update Helm Values | |
| # needs: build-and-push | |
| # runs-on: ubuntu-latest | |
| # env: | |
| # IMAGE_TAG: ${{ needs.build-and-push.outputs.image-tag }} | |
| # IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/springboot-postgres | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Update image.tag in values.yaml | |
| # run: | | |
| # FILE="helm/springboot-postgres-prod/values.yaml" | |
| # echo "Updating $FILE with image tag $IMAGE_TAG" | |
| # # Replace the image tag line | |
| # sed -i.bak -E "s|tag:.*|tag: \"$IMAGE_TAG\"|" "$FILE" | |
| # - name: Commit and Push changes | |
| # run: | | |
| # git config --global user.name "github-actions" | |
| # git config --global user.email "github-actions@github.com" | |
| # git add helm/springboot-postgres-prod/values.yaml | |
| # git commit -m "Update Helm image tag to $IMAGE_TAG" | |
| # git push |