Skip to content

Commit

Permalink
Sf voucher (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyfilyanin authored Apr 25, 2024
1 parent 60d1c07 commit 126932c
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/Update-Voucher-Mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Deploy Production Voucher app to k8s mainnet"

on:
push:
branches: ['main']
paths:
- idea/voucher-indexer/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}


jobs:

build-voucher-image:
runs-on: ubuntu-latest
environment: staging
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the github container registry
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Frontend Docker image
uses: docker/build-push-action@master
with:
file: idea/voucher-indexer/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-voucher:prod


deploy-to-k8s-mainnet:
needs: [build-voucher-image]
runs-on: ubuntu-latest

steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Deploy to k8s
uses: sergeyfilyanin/kubectl-aws-eks@master
with:
args: rollout restart deployment voucher-mainnet -n prod-idea

- name: Check k8s deployments
uses: sergeyfilyanin/kubectl-aws-eks@master
with:
args: get deployment -o name -n prod-idea | xargs -n1 -t kubectl rollout status -n prod-idea --timeout=120s
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Deploy Voucher app to k8s"
name: "Deploy Develop Voucher app to k8s testnet"

on:
push:
Expand Down

0 comments on commit 126932c

Please sign in to comment.