Skip to content

fix(prayer-time): adjust response api from prayer time (#30) #51

fix(prayer-time): adjust response api from prayer time (#30)

fix(prayer-time): adjust response api from prayer time (#30) #51

name: Build-push-staging
on:
push:
branches: [ main ]
jobs:
deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Configure Docker with Credentials
- name: Configure Docker
run: |
docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME_ALJABBAR }} -p "${{ secrets.REGISTRY_PASSWORD_ALJABBAR }}"
# Build the Docker image
- name: Set version tag
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
file: docker/Dockerfile
context: .
push: true
tags: ${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}
# GitOps
- name: GitOps ArgoCD Setup
run: |
echo "${{ secrets.GITLAB_ARGOCD_KEY }}" > /tmp/gitlab-deploy-ssh-key
chmod 600 /tmp/gitlab-deploy-ssh-key
export GIT_SSH_COMMAND="ssh -i /tmp/gitlab-deploy-ssh-key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
git clone ${{ secrets.GITLAB_ARGOCD_REPOSITORY }}
- name: GitOps ArgoCD Update Image Tag Aljabbar Service Staging
uses: mikefarah/yq@master
with:
cmd: yq -i '.spec.template.spec.containers[0].image = "${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}"' 'jds-terraform-gke/k8s/aljabbar/development/aljabbar-api/deployment.yaml'
- name: GitOps ArgoCD Update Image Tag Aljabbar Service Cron CoreData Staging
uses: mikefarah/yq@master
with:
cmd: yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}"' 'jds-terraform-gke/k8s/aljabbar/development/aljabbar-api/01-cronjob-coredata.yaml'
- name: GitOps ArgoCD Update Image Tag Aljabbar Service Cron Youtube Staging
uses: mikefarah/yq@master
with:
cmd: yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}"' 'jds-terraform-gke/k8s/aljabbar/development/aljabbar-api/02-cronjob-youtube.yaml'
- name: GitOps ArgoCD Update Image Tag Aljabbar Service Cron Prayer Times Staging
uses: mikefarah/yq@master
with:
cmd: yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}"' 'jds-terraform-gke/k8s/aljabbar/development/aljabbar-api/03-cronjob-prayertime.yaml'
- name: GitOps ArgoCD Update Image Tag Aljabbar Service Cron Jabarprov Staging
uses: mikefarah/yq@master
with:
cmd: yq -i '.spec.jobTemplate.spec.template.spec.containers[0].image = "${{ secrets.ALJABBAR_SERVICE_IMAGENAME }}:${{ steps.vars.outputs.sha_short }}"' 'jds-terraform-gke/k8s/aljabbar/development/aljabbar-api/04-cronjob-jabarprov.yaml'
- name: GitOps ArgoCD Create Branch, Commit, Push
run: |
export GIT_SSH_COMMAND="ssh -i /tmp/gitlab-deploy-ssh-key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
cd jds-terraform-gke/k8s/aljabbar/development/aljabbar-api
git config user.email "github-action@github.com"
git config user.name "Github Action"
git add .
git commit -m "AL JABBAR Sync Staging"
git push origin master