Skip to content

Some nits.

Some nits. #34

Workflow file for this run

name: Portable Maci CICD
on:
push:
branches: [ dev, main ]
jobs:
build:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
steps:
- name: Git clone the repository
uses: actions/checkout@v1
- name: Build image
env:
BUILD_ARG: ${{ github.ref_name }}
run: |
docker build -t portable-maci:local -f Dockerfile .
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ap-southeast-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'
- name: Tag, push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: portable-maci
IMAGE_TAG: ${{ github.ref_name }}
run: |
docker tag portable-maci:local $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Redeploy on aws
env:
SUFFIX: ${{ fromJson('["-prod -n webapp", "-dev"]')[github.ref_name == 'dev'] }}
run: |
aws eks update-kubeconfig --region ap-southeast-1 --name ${{ secrets.EKS_CLUSTER }}
kubectl rollout restart deploy portable-maci$SUFFIX