Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
ci: use correct syntax on the action
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-hosseini-deriv committed Nov 20, 2023
1 parent 1d754ce commit d5af2a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 35 deletions.
26 changes: 12 additions & 14 deletions .github/actions/deploy_to_kubernetes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@ inputs:
K8S_VERSION:
description: Kubernetes version
required: true
type: string
K8S_NAMESPACE:
description: Kubernetes namespace
required: false
type: string
default: 'deriv-com-api-staging'
CA_CRT:
description: Kubernetes CA certificate
required: true
type: string
steps:
- k8s/install-kubectl
- run:
name: Deploying to k8s cluster for service ${{ inputs.K8S_NAMESPACE }} 🚀
command: |
export NAMESPACE=${{ inputs.K8S_NAMESPACE }}
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo ${{ inputs.CA_CRT }} | base64 --decode > ca.crt
export CA="ca.crt"
./release.sh deriv-com-api ${{ inputs.K8S_VERSION }}
runs:
using: composite
steps:
- name: Deploying to k8s cluster for service ${{ inputs.K8S_NAMESPACE }} 🚀
run: |
export NAMESPACE=${{ inputs.K8S_NAMESPACE }}
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo ${{ inputs.CA_CRT }} | base64 --decode > ca.crt
export CA="ca.crt"
./release.sh deriv-com-api ${{ inputs.K8S_VERSION }}
shell: bash
39 changes: 18 additions & 21 deletions .github/actions/publish_to_docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,34 @@ inputs:
description: Docker image tag
required: false
default: 'latest-staging'
type: string
DOCKER_IMAGE_TAG:
description: Docker image tag
required: true
type: string
DOCKERHUB_ORGANISATION:
description: Docker Hub organisation
required: true
type: string
DOCKERHUB_USERNAME:
description: Docker Hub username
required: true
type: string
DOCKERHUB_PASSWORD:
description: Docker Hub password
required: true
type: string
runs:
using: composite
steps:
- setup_remote_docker
- run:
name: Building docker image 🐳
command: |
docker build -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }} -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} .
- name: Verify nginx image
run: |
set -e
docker run --rm ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} nginx -t
echo "docker image validated successfully"
- run:
name: Pushing Image to docker hub 🐳
command: |
echo ${{ inputs.DOCKERHUB_PASSWORD }} | docker login -u $${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }}
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }}
- name: Building docker image 🐳
run: |
docker build -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }} -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} .
shell: bash
- name: Verify nginx image
run: |
set -e
docker run --rm ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} 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 ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }}
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }}
shell: bash

0 comments on commit d5af2a7

Please sign in to comment.