Skip to content

feature/layout swagger endpoints #16

feature/layout swagger endpoints

feature/layout swagger endpoints #16

name: Build and push to ECR(tokenguard-dev)
on:
push:
branches: ['dev']
pull_request:
branches: ['dev']
workflow_dispatch:
env:
AWS_REGION: eu-west-1
jobs:
# run-tests:
# name: Run tests
# if: github.event_name == 'pull_request' || github.event_name == 'push'
# runs-on: ubuntu-latest
# steps:
# - name: Check out code
# uses: actions/checkout@v3
# - name: Run tests
# run: docker-compose -f docker-compose.test.yml run server npm test
build-push:
name: Build image and push to ECR(tokenguard-dev)
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
# needs: run-tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
# Setup hardware emulator using QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm64,linux/amd64
# Setup Docker Builderx for multi-arch images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag and push to Amazon ECR
id: build-push-ecr
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.login-ecr.outputs.registry }}/tokenguard-dev-dashboard-creator-server:${{ github.sha }}
- name: Image digest
run: echo ${{ steps.build-push-ecr.outputs.digest }}
deploy-eks:
name: Deploy image on EKS(tokenguard-dev)
needs: build-push
runs-on: self-hosted
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Deploy to tokenguard-dev
uses: christallire/[email protected]
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA_DEV }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: tokenguard-dev-dashboard-creator-server
IMAGE_TAG: ${{ github.sha }}
with:
args: -n dev set image deployment/dashboard-creator-server dashboard-creator-server=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: verify deployment
uses: christallire/[email protected]
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA_DEV }}
with:
args: -n dev rollout status deployment/dashboard-creator-server