Skip to content

Commit

Permalink
Merge pull request #4 from IntelliSOFT-Consulting/disableAutamatedDeploy
Browse files Browse the repository at this point in the history
disable automated deployment
  • Loading branch information
daviemukungi authored Oct 17, 2024
2 parents 4101d24 + af4240d commit 9a4ba27
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 107 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/build_upload.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload
# name: Build and Upload
# on:
# push:
# branches:
Expand All @@ -16,75 +16,75 @@ name: Build and Upload
# - '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: 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: bahmni/standard-config:${{env.ARTIFACT_VERSION}},bahmni/standard-config:latest
- name: Push Translations to Transifex
run: |
curl -o transifex.sh https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/transifex.sh
chmod +x transifex.sh
./transifex.sh push
rm transifex.sh
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- 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
# 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: 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: bahmni/standard-config:${{env.ARTIFACT_VERSION}},bahmni/standard-config:latest
# - name: Push Translations to Transifex
# run: |
# curl -o transifex.sh https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/transifex.sh
# chmod +x transifex.sh
# ./transifex.sh push
# rm transifex.sh
# env:
# TX_TOKEN: ${{ secrets.TX_TOKEN }}
# - 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 Lint
# run: helm lint $HELM_CHART_PATH

- name: Helm Package
run: helm package $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: 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: 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: 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
# - 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
80 changes: 40 additions & 40 deletions .github/workflows/pull_translations.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: Pull Translations from Transifex
# name: Pull Translations from Transifex

on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
# on:
# schedule:
# - cron: '0 0 1 * *'
# workflow_dispatch:

jobs:
pull-translations:
name: Pull Translations from Transifex
runs-on: ubuntu-latest
permissions:
contents: write
# jobs:
# pull-translations:
# name: Pull Translations from Transifex
# runs-on: ubuntu-latest
# permissions:
# contents: write

steps:
- name: Checkout code
uses: actions/checkout@v3
# steps:
# - name: Checkout code
# uses: actions/checkout@v3

- name: Pull Translations from Transifex
run: |
curl -o transifex.sh https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/transifex.sh
chmod +x transifex.sh
./transifex.sh pull
rm transifex.sh
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
# - name: Pull Translations from Transifex
# run: |
# curl -o transifex.sh https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/transifex.sh
# chmod +x transifex.sh
# ./transifex.sh pull
# rm transifex.sh
# env:
# TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Commit and push changes
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[Bahmni Infra] | Add. Update Translation Resources"
branch: ${{ github.ref }}
file_pattern: 'openmrs/i18n/**/*.json'
repository: .
commit_user_name: Bahmni Infra
commit_user_email: [email protected]
commit_author: bahmni-infra <[email protected]>
# - name: Commit and push changes
# id: auto-commit-action
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "[Bahmni Infra] | Add. Update Translation Resources"
# branch: ${{ github.ref }}
# file_pattern: 'openmrs/i18n/**/*.json'
# repository: .
# commit_user_name: Bahmni Infra
# commit_user_email: [email protected]
# commit_author: bahmni-infra <[email protected]>

- name: Check for changes
run: |
if [[ steps.auto-commit-action.outputs.changes_detected == 'true' ]]; then
echo "Changes Detected. Translation Resources Updated."
else
echo "No Changes Detected. Project Already Up-To-Date."
fi
# - name: Check for changes
# run: |
# if [[ steps.auto-commit-action.outputs.changes_detected == 'true' ]]; then
# echo "Changes Detected. Translation Resources Updated."
# else
# echo "No Changes Detected. Project Already Up-To-Date."
# fi

0 comments on commit 9a4ba27

Please sign in to comment.