try test the github action + argocd #11
This file contains 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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build the Docker image | |
run: docker build . --file app/dockerfile --tag moosavismd/uid-app:${{ github.sha }} | |
- name: Push docker image | |
run: docker push moosavismd/uid-app:${{ github.sha }} | |
- name: Update values.yaml | |
run: | | |
cd charts/app-uid | |
sed -i 's|tag:.*|APP_VERSION: '${{ github.sha }}'|' values.yaml | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add values.yaml | |
git commit -m "Update values.yaml" | |
git push |