Skip to content

Commit

Permalink
Merge pull request #218 from 0xPolygonID/DEVOPS-1
Browse files Browse the repository at this point in the history
DEVOPS-1 Fix mispelling command and improve the GitHub Action order
  • Loading branch information
gseriche authored Nov 8, 2024
2 parents 3fa73e1 + 3d4fdf0 commit 054142c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/deployment_new_aws_account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
ECR_REPOSITORY: devs-ecr
ECS_SERVICE: devs-ecs-service

Expand All @@ -26,27 +27,24 @@ jobs:

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'

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

- name: Create .env file
run: echo 'ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }}' >> .env
run: echo 'ALGOLIA_APP_ID=${{ secrets.ALGOLIA_APP_ID }}' >> .env
run: |
cat <<EOF >> .env
ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID=${{ secrets.ALGOLIA_APP_ID }}
EOF
# Runs a single command using the runners shell
- name: Build
run: npm run build

Expand All @@ -56,7 +54,7 @@ jobs:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker build --cache-from $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 054142c

Please sign in to comment.