updated local ollama yml #81
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
| # Resources : https://github.com/marketplace/actions/build-and-push-docker-images | |
| # https://github.com/actions/starter-workflows/blob/main/ci/docker-image.yml | |
| name: ci | |
| on: | |
| push: | |
| jobs: | |
| build_push_python_ms: | |
| if: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} # Use secrets for sensitive info | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} # Use secrets for sensitive info | |
| # - name: Build and push | |
| # uses: docker/build-push-action@v6 | |
| # with: | |
| # push: true | |
| # context: "{{defaultContext}}:microservices/python-microservice" # Set the build context to the directory with the Dockerfile | |
| # platforms: linux/amd64, linux/arm64 | |
| # tags: ${{ vars.DOCKERHUB_USERNAME }}/python-ms-crisp-devops:${{ github.run_id }}-${{ github.sha }} # Use secrets for sensitive info | |
| build_push_golang_ms: | |
| if: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} # Use secrets for sensitive info | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} # Use secrets for sensitive info | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| context: "{{defaultContext}}:microservices/golang-microservice" # Set the build context to the directory with the Dockerfile | |
| platforms: linux/amd64, linux/arm64 | |
| tags: ${{ vars.DOCKERHUB_USERNAME }}/golang-ms-crisp-devops:${{ github.run_id }}-${{ github.sha }} # Use secrets for sensitive info | |
| update_helm_tags_golang: | |
| if: false | |
| needs: build_push_golang_ms | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: main | |
| # - name: Present working directory | |
| # run: pwd | |
| # - name: List files | |
| # run: ls -R | |
| - name: Update Helm `values.yaml` with new image tag | |
| run: | | |
| # Extract the short SHA for easier reading | |
| TAG=${{ github.run_id }}-${{ github.sha }} | |
| # Use yq or sed to update the image tag in values.yaml | |
| pwd | |
| ls -lrth | |
| yq eval ".image.tag = \"${TAG}\"" -i ${{ github.workspace }}/k8s-manifests-helm/golang-helm/values.yaml | |
| # sed -i "s/tag:.*/tag: ${TAG}/" -i ${{ github.workspace }}/k8s-manifests-helm/golang-helm/values.yaml | |
| - name: Commit changes to values.yaml | |
| run: | | |
| git config --global user.email ${{ vars.GH_EMAIL }} | |
| git config --global user.name ${{ vars.GH_USERNAME }} | |
| git add ./k8s-manifests-helm/golang-helm/values.yaml | |
| git commit -m "Update image tag to ${{ github.run_id }}-${{ github.sha }}" | |
| git push | |
| - name: Commit and push changes | |
| uses: devops-infra/[email protected] | |
| with: | |
| github_token: ${{ secrets.IMAGE_TAG_UPDATE_GH_TOKEN }} | |
| commit_message: Updated image tag of Golang helm chart | |
| # Source: https://github.com/marketplace/actions/create-pull-request | |
| # - name: Create Pull Request (Commit and create PR) | |
| # uses: peter-evans/create-pull-request@v7 | |
| # with: | |
| # token: ${{ secrets.IMAGE_TAG_UPDATE_GH_TOKEN }} | |
| # commit-message: Updated image tag of Golang helm chart | |
| # title: Updated image tag of Golang helm chart | |
| # body: | | |
| # - Updated docker image tags with ${{ github.run_id }}-${{ github.sha }} values | |
| update_helm_tags_python: | |
| if: false | |
| needs: build_push_python_ms | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: main | |
| # - name: Present working directory | |
| # run: pwd | |
| # - name: List files | |
| # run: ls -R | |
| - name: Update Helm `values.yaml` with new image tag | |
| run: | | |
| # Extract the short SHA for easier reading | |
| TAG=${{ github.run_id }}-${{ github.sha }} | |
| # Use yq or sed to update the image tag in values.yaml | |
| pwd | |
| ls -lrth | |
| yq eval ".image.tag = \"${TAG}\"" -i ${{ github.workspace }}/k8s-manifests-helm/python-helm/values.yaml | |
| # sed -i "s/tag:.*/tag: ${TAG}/" -i ${{ github.workspace }}/k8s-manifests-helm/python-helm/values.yaml | |
| - name: Commit changes to values.yaml | |
| run: | | |
| git config --global user.email ${{ vars.GH_EMAIL }} | |
| git config --global user.name ${{ vars.GH_USERNAME }} | |
| git add ./k8s-manifests-helm/python-helm/values.yaml | |
| git commit -m "Update image tag to ${{ github.run_id }}-${{ github.sha }}" | |
| git push | |
| - name: Commit and push changes | |
| uses: devops-infra/[email protected] | |
| with: | |
| github_token: ${{ secrets.IMAGE_TAG_UPDATE_GH_TOKEN }} | |
| commit_message: Updated image tag of Python helm chart | |
| # Source: https://github.com/marketplace/actions/create-pull-request | |
| # - name: Create Pull Request (Commit and create PR) | |
| # uses: peter-evans/create-pull-request@v7 | |
| # with: | |
| # token: ${{ secrets.IMAGE_TAG_UPDATE_GH_TOKEN }} | |
| # commit-message: Updated image tag of Golang helm chart | |
| # title: Updated image tag of Python helm chart | |
| # body: | | |
| # - Updated docker image tags with ${{ github.run_id }}-${{ github.sha }} values |