try to null auth type #4
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 Dev Deployment | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - test | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Set IMAGE_TAG | |
| run: | | |
| if [[ "${{ github.ref_name }}" == "test" ]]; then | |
| echo "IMAGE_TAG=test" >> $GITHUB_ENV | |
| else | |
| echo "IMAGE_TAG=dev" >> $GITHUB_ENV | |
| fi | |
| - 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: Build Docker image and push | |
| env: | |
| REGISTRY: ${{ steps.ecr-login.outputs.registry }} | |
| REPOSITORY: "/mage/server" | |
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | |
| run: | | |
| docker build -t $REGISTRY$REPOSITORY:$IMAGE_TAG . | |
| docker push $REGISTRY$REPOSITORY:$IMAGE_TAG | |
| - name: ReDeploy ECS Service | |
| env: | |
| SERVICE: "mage${{ env.IMAGE_TAG }}" | |
| run: | | |
| aws ecs update-service --cluster magedev --service $SERVICE --force-new-deployment |