Skip to content

Commit 054142c

Browse files
authored
Merge pull request #218 from 0xPolygonID/DEVOPS-1
DEVOPS-1 Fix mispelling command and improve the GitHub Action order
2 parents 3fa73e1 + 3d4fdf0 commit 054142c

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

.github/workflows/deployment_new_aws_account.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
env:
1010
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
11+
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
1112
ECR_REPOSITORY: devs-ecr
1213
ECS_SERVICE: devs-ecs-service
1314

@@ -26,27 +27,24 @@ jobs:
2627

2728
- name: Configure AWS credentials
2829
uses: aws-actions/configure-aws-credentials@v4
29-
env:
30-
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
3130
with:
3231
aws-region: ${{ env.AWS_REGION }}
3332
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
3433
role-session-name: GithubActionsSession
3534

3635
- name: Login to Amazon ECR
37-
id: login-ecr
3836
uses: aws-actions/amazon-ecr-login@v1
39-
with:
40-
mask-password: 'true'
4137

4238
- name: Install dependencies
4339
run: rm -rf node_modules && npm ci
4440

4541
- name: Create .env file
46-
run: echo 'ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }}' >> .env
47-
run: echo 'ALGOLIA_APP_ID=${{ secrets.ALGOLIA_APP_ID }}' >> .env
42+
run: |
43+
cat <<EOF >> .env
44+
ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }}
45+
ALGOLIA_APP_ID=${{ secrets.ALGOLIA_APP_ID }}
46+
EOF
4847
49-
# Runs a single command using the runners shell
5048
- name: Build
5149
run: npm run build
5250

@@ -56,7 +54,7 @@ jobs:
5654
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
5755
IMAGE_TAG: ${{ github.sha }}
5856
run: |
59-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
57+
docker build --cache-from $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
6058
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
6159
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
6260

0 commit comments

Comments
 (0)