Skip to content

Update stash.sh and stuffs configuration (#9) #14

Update stash.sh and stuffs configuration (#9)

Update stash.sh and stuffs configuration (#9) #14

Workflow file for this run

name: Deploy to the production
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
name: Build Image
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::423238210111:role/github-cicd-deploymennt
aws-region: ap-southeast-2
- name: Login to Amazon ECR Private
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Load secrets and save to .env
run: aws secretsmanager get-secret-value --secret-id simple_bank_secret --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value)")|.[]' > app.env
- name: Check app.env content
run: cat app.env
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: simple_bank
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG