confirm vars #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AWS Role Test | |
| on: | |
| push: | |
| branches: | |
| - dev-actions | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: AWS config | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_DEV_ROLE }} | |
| role-session-name: GithubNGAGeointSession | |
| aws-region: ${{ secrets.AWS_DEV_REGION }} | |
| - name: AWS ECR Login | |
| id: ecr-login | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Set IMAGE_TAG | |
| run: | | |
| if [[ "${{ github.ref_name }}" == "test" ]]; then | |
| echo "IMAGE_TAG=test" >> $GITHUB_ENV | |
| else | |
| echo "IMAGE_TAG=dev" >> $GITHUB_ENV | |
| - name: Build Docker image and push | |
| env: | |
| REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
| REPOSITORY: "mage/server" | |
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | |
| run: | |
| echo "REGISTRY IS" | |
| echo $REGISTRY | |
| echo "TAG IS" | |
| echo $IMAGE_TAG | |
| echo "using env " | |
| echo $env.IMAGE_TAG | |
| - name: TEST ECR Access | |
| run: aws ecr describe-repositories | |
| - name: TEST ECS Access | |
| run: aws ecs list-clusters |