Skip to content

Commit

Permalink
fix(gha-build-ecr): learning how inputs work
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandoataoldotcom authored Oct 14, 2023
1 parent b95af75 commit ade4f02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-action-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
run: |
echo "TEST_IMAGE_NAME=glueops/github-actions-build-push-containers/test-github-actions-build-push-containers" >> $GITHUB_ENV
echo "ECR_REGISTRY=616531474007.dkr.ecr.us-west-2.amazonaws.com" >> $GITHUB_ENV
echo "AWS_REGION=us-west-2" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -36,13 +37,13 @@ jobs:
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_default_region: "us-west-2"
aws_default_region: ${{ env.AWS_REGION }}
image_name: ${{ env.TEST_IMAGE_NAME }}
registry: ${{ env.ECR_REGISTRY }}

- name: verify ecr
run: |
echo $(aws ecr get-login-password --region ${{ inputs.aws_default_region }}) \
echo $(aws ecr get-login-password --region $AWS_REGION) \
| docker login --username AWS --password-stdin ${{ inputs.registry }}
docker pull $ECR_REGISTRY/$TEST_IMAGE_NAME:${{ github.sha }}
docker run $ECR_REGISTRY/$TEST_IMAGE_NAME:${{ github.sha }}
Expand Down

0 comments on commit ade4f02

Please sign in to comment.