Skip to content

Commit

Permalink
ci: add bash and format the action (#11445)
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-hosseini-deriv committed Nov 15, 2023
1 parent 80e3fdf commit 7ce8948
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions .github/actions/build_and_push_docker_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ name: build_and_push_docker_image_and_k8s
description: Build docker image and push to docker hub and K8S
inputs:
DOCKERHUB_ORGANISATION:
description: 'Dockerhub Organisation'
description: "Dockerhub Organisation"
required: true
DOCKERHUB_USERNAME:
description: 'Dockerhub Username'
description: "Dockerhub Username"
required: true
DOCKERHUB_PASSWORD:
description: 'Dockerhub Password'
description: "Dockerhub Password"
required: true
K8S_NAMESPACE:
description: 'K8S namespace'
description: "K8S namespace"
required: true
K8S_SERVICE:
description: 'K8S service'
description: "K8S service"
required: true
KUBE_SERVER:
description: 'K8S server'
description: "K8S server"
required: true
SERVICEACCOUNT_TOKEN:
description: 'K8S service account token'
description: "K8S service account token"
required: true
CA_CRT:
description: 'K8S CA_CRT'
description: "K8S CA_CRT"
required: true
APP_VERSION:
description: 'App version'
description: "App version"
required: true
runs:
using: composite
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
uses: actions/checkout@v4
- name: Setup Environment variables
run: |
export NAMESPACE=${{ inputs.K8S_NAMESPACE }}
Expand All @@ -45,23 +45,23 @@ runs:
shell: bash
- name: Build docker image 🐳
run: docker build -t ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${APP_VERSION} -t ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${{ github.ref_name }} .

shell: bash
- name: Verify nginx image
run: |
set -e
docker run --rm ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${{ github.ref_name }} nginx -t
echo "docker image validated successfully"
set -e
docker run --rm ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${{ github.ref_name }} nginx -t
echo "docker image validated successfully"
shell: bash
- name: Pushing Image to docker hub 🐳
run: |
echo ${{ inputs.DOCKERHUB_PASSWORD }}| docker login -u ${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
docker push ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${APP_VERSION}
docker push ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${{ github.ref_name }}
echo ${{ inputs.DOCKERHUB_PASSWORD }}| docker login -u ${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
docker push ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${APP_VERSION}
docker push ${DOCKERHUB_ORGANISATION}/${APP_NAME}:${{ github.ref_name }}
shell: bash
- name: Deploy πŸš€
run: |
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo $CA_CRT | base64 --decode > ca.crt
./release.sh ${APP_NAME} ${{ github.ref_name }}
shell: bash
- name: Deploy πŸš€
run: |
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo $CA_CRT | base64 --decode > ca.crt
./release.sh ${APP_NAME} ${{ github.ref_name }}
shell: bash

1 comment on commit 7ce8948

@vercel
Copy link

@vercel vercel bot commented on 7ce8948 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx

Please sign in to comment.