Skip to content

Build Image For Repo #18

Build Image For Repo

Build Image For Repo #18

Workflow file for this run

name: Acorus Image Build Only
on:
pull_request:
branches:
- main
env:
AWS_REGION : "ap-southeast-1"
permissions:
id-token: write # This is required for requesting the JWT
contents: read
run-name: Build Image For Repo
jobs:
build:
permissions:
pull-requests: write
runs-on: ubuntu-latest
#runs-on: [self-hosted, Linux, X64, eks, mantle-default, "${{ github.event.inputs.env }}"]
outputs:
commit_sha: ${{ steps.get-commit-sha.outputs.commit_sha }}
ecr_registry: ${{ steps.login-ecr.outputs.registry }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get Commit Sha
id: get-commit-sha
run: |
echo "::set-output name=commit_sha::$(git rev-parse --short=7 HEAD)"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::942583694543:role/github-action-role
aws-region: ${{ env.AWS_REGION }}
role-session-name: samplerolesession
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Build Docker Image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPO: acorus
#REF: ${{ github.event.inputs.ref }}
COMMIT_SHA: ${{ steps.get-commit-sha.outputs.commit_sha }}
run: |
IMAGE_URL1=${ECR_REGISTRY}/${REPO}:${COMMIT_SHA}
export NODE_OPTIONS="--max_old_space_size=9000"
docker build --pull -t ${IMAGE_URL1} .
docker push ${IMAGE_URL1}