Merge branch 'HCSBA-bahmni:master' into master #2
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 Upload | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'release-*' | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| paths-ignore: | |
| - "**.md" | |
| workflow_run: | |
| workflows: [Pull Translations from Transifex] | |
| types: [completed] | |
| branches: | |
| - master | |
| - 'release-*' | |
| workflow_dispatch: | |
| jobs: | |
| build-publish-docker-helm: | |
| name: Build & Publish Docker Image & Helm Chart | |
| runs-on: ubuntu-latest | |
| env: | |
| HELM_CHART_PATH: package/helm | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Listar archivos en el directorio .tx | |
| run: ls -la .tx/ | |
| - name: Instalar Cliente de Transifex | |
| run: | | |
| curl -o transifex.sh https://raw.githubusercontent.com/transifex/cli/master/install.sh | |
| bash transifex.sh | |
| mkdir -p $HOME/bin | |
| mv tx $HOME/bin/tx | |
| shell: bash | |
| - name: Configurar PATH para el cliente de Transifex | |
| run: echo "$HOME/bin:$PATH" >> $GITHUB_PATH | |
| - name: Verificar instalación del cliente Transifex | |
| run: $HOME/bin/tx --version | |
| - name: Pull Translations from Transifex | |
| run: $HOME/bin/tx pull -l es | |
| env: | |
| TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
| - name: Set env.ARTIFACT_VERSION | |
| run: | | |
| wget -q https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/setArtifactVersion.sh && chmod +x setArtifactVersion.sh | |
| ./setArtifactVersion.sh | |
| rm setArtifactVersion.sh | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Docker - Login | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Docker - Build and push | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: . | |
| file: package/docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: cuentasio/standard-config:${{env.ARTIFACT_VERSION}},cuentasio/standard-config:latest | |
| - name: Update Version and Image Tag | |
| run: | | |
| yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml | |
| yq --inplace '.version = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/Chart.yaml | |
| - name: Helm Lint | |
| run: helm lint $HELM_CHART_PATH | |
| - name: Helm Package | |
| run: helm package $HELM_CHART_PATH | |
| - name: Checkout Charts Repository | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: Bahmni/helm-charts | |
| ref: gh-pages | |
| path: helm-charts | |
| persist-credentials: false | |
| - name: Copy Helm Archive | |
| run: mkdir -p helm-charts/standard-config/ && cp standard-config-${{ env.ARTIFACT_VERSION }}.tgz helm-charts/standard-config/ | |
| - name: Helm Index | |
| working-directory: helm-charts/ | |
| run: helm repo index --merge index.yaml --url https://bahmni.github.io/helm-charts/ . | |
| - name: Commit and Push Chart Repository | |
| working-directory: helm-charts/ | |
| run: | | |
| git config user.name ${{ secrets.BAHMNI_USERNAME}} | |
| git config user.email ${{ secrets.BAHMNI_EMAIL}} | |
| git add . | |
| git commit -m "Release of standard-config-${{ env.ARTIFACT_VERSION }}" | |
| git push 'https://${{ secrets.BAHMNI_USERNAME}}:${{ secrets.BAHMNI_PAT}}@github.com/bahmni/helm-charts.git' gh-pages |