Skip to content

feat: production-ready python-probe with multi-environment support #9

feat: production-ready python-probe with multi-environment support

feat: production-ready python-probe with multi-environment support #9

Workflow file for this run

name: cicd
on:
push:
paths:
- src/**
brances:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Shorten commit id
shell: bash
run: |
echo "COMMIT_ID=${GITHUB_SHA::6}" >> "$GITHUB_ENV"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: tyrelfecha/python-app:${{ env.COMMIT_ID }}
outputs:
commit_id: ${{ env.COMMIT_ID }}
cd:
needs: ci
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Modify values file
shell: bash
run: |
echo ${{needs.ci.outputs.commit_id}}
pip install yq
yq -Yi '.image.tag = "${{needs.ci.outputs.commit_id}}"' chart/python-app/values.yaml
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Updates values.yaml with commit ${{needs.ci.outputs.commit_id}}'
- name: Install argocd
shell: bash
run: |
curl -ksSL -o argocd-linux-amd64 https://argocd-server.argocd/download/argocd-linux-amd64
chmod +x argocd-linux-amd64
sudo mv argocd-linux-amd64 /usr/local/bin/argocd
- name: Argocd app sync
shell: bash
run: |
argocd login argocd-server.argocd \
--insecure \
--grpc-web \
--username admin \
--password ${{ secrets.ARGOCD_PASSWORD }}
argocd app sync python-app