Skip to content

Commit

Permalink
feat: Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ybgbob committed Nov 14, 2023
1 parent 83b4d95 commit abe7504
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
REGION: us-east-1
ECR_REGISTRY_ID: 553885929720
AWS_ASSUMED_ROLE_ARN: arn:aws:iam::553885929720:role/tf_nodereal_prod_ecr_cicd_deployment_assume_role
STATIC_BUCKET: tf-nodereal-prod-nodereal-static
### IMPORTANT !!!! ###
### The following three need to be modified according to your project ###
Expand All @@ -20,18 +19,10 @@ env:

jobs:
build:
runs-on: [self-hosted, qa-infra-k8s]
runs-on: [prod-cicd-runners]
# if: "contains(github.event.head_commit.message, 'aptos-trace')"
steps:
- uses: actions/checkout@v3
- name: aws assume role
id: aws-assume-role
run: |
UUID=$(cat /proc/sys/kernel/random/uuid)
OUT=$(aws sts assume-role --role-arn $AWS_ASSUMED_ROLE_ARN --role-session-name $UUID)
echo ::set-output name=aws_access_key_id::"$(echo $OUT | jq -r '.Credentials''.AccessKeyId')"
echo ::set-output name=aws_secret_key::"$(echo $OUT | jq -r '.Credentials''.SecretAccessKey')"
echo ::set-output name=aws_sessions_token::"$(echo $OUT | jq -r '.Credentials''.SessionToken')"
- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -54,8 +45,6 @@ jobs:
GIT_COMMIT=${GITHUB_SHA}
IMAGE_NAME="${ECR_REGISTRY_ID}.dkr.ecr.${REGION}.amazonaws.com/${APP_NAME}:${GITHUB_SHA}"
aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY_ID}.dkr.ecr.${REGION}.amazonaws.com
aws ecr --region ${REGION} describe-repositories --registry-id ${ECR_REGISTRY_ID} --repository-names ${APP_NAME} || aws ecr --region ${REGION} create-repository --repository-name ${APP_NAME}
aws ecr --region ${REGION} set-repository-policy --registry-id ${ECR_REGISTRY_ID} --repository-name ${APP_NAME} --policy-text file:///home/runner/repo-access-permissions.json || true
#### Write your own build arg for your project
docker build --build-arg COMMIT_SHA=${GIT_COMMIT} \
Expand Down

0 comments on commit abe7504

Please sign in to comment.