refactor: dep update #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
ECR_REGISTRY: 132721373801.dkr.ecr.ap-south-1.amazonaws.com/discord_discordx | |
KUBE_CONTAINER_NAME: discordx | |
KUBE_DEPLOYMENT_NAME: discordx | |
KUBE_NAMESPACE: discord | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
outputs: | |
image_uri: ${{ steps.tag.outputs.current }} | |
steps: | |
- name: check out code 🛎 | |
uses: actions/checkout@main | |
- name: check out buildx | |
uses: docker/setup-buildx-action@master | |
id: buildx | |
with: | |
install: true | |
- name: Prepare Tag | |
id: tag | |
run: | | |
echo "current=${{ env.ECR_REGISTRY }}:`date +"%y.%m.%d.%H.%M"`" >> $GITHUB_OUTPUT | |
echo "latest=${{ env.ECR_REGISTRY }}:latest" >> $GITHUB_OUTPUT | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@main | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-south-1 | |
mask-aws-account-id: "no" | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@main | |
- name: Build and Push | |
uses: docker/build-push-action@master | |
with: | |
push: true | |
tags: ${{ steps.tag.outputs.current }}, ${{ steps.tag.outputs.latest }} | |
deploy: | |
name: Deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: deploy to cluster | |
uses: kodermax/kubectl-aws-eks@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} | |
with: | |
args: set image deployment/${{ env.KUBE_DEPLOYMENT_NAME }} ${{ env.KUBE_CONTAINER_NAME }}=${{ needs.build.outputs.image_uri }} -n ${{ env.KUBE_NAMESPACE }} | |
- name: verify deployment | |
uses: kodermax/kubectl-aws-eks@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} | |
with: | |
args: rollout status deployment/${{ env.KUBE_DEPLOYMENT_NAME }} -n ${{ env.KUBE_NAMESPACE }} |