diff --git a/.github/workflows/build-qa.yml b/.github/workflows/build-qa.yml index 66998ad5..a1e94446 100644 --- a/.github/workflows/build-qa.yml +++ b/.github/workflows/build-qa.yml @@ -2,50 +2,52 @@ # build a container and deploy to ECR name: Publish qa on: - pull_request: - branches: [fc-components] - types: [pull_request] + push: + branches: + - github-actions +# pull_request: +# branches: [fc-components] +# types: [closed] jobs: publish_qa: - name: Publish image to ECR - if: github.event.pull_request.merged + name: Publish image to ECR + # Temporarily removing this line for testing purposes + # if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - name: checkout - - uses: actions/checkout@v2 + uses: actions/checkout@v2 - - id: nvmrc + - id: nvmrc run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) - - uses: actions/setup-node@v2 + - name: Set up node with version from nvm + uses: actions/setup-node@v2 with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } - - run: npm install - - run: npm build - - name: Configure AWS credentials from Test account - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 - - name: Build, tag, and push image to Amazon ECR - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: sfr-front-end - IMAGE_TAG: ${{ github.sha }} - run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest - docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest + - name: Build, tag, and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: sfr-front-end + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest + docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest - - name: Force ECS Update - run: | - aws ecs update-service --cluster sfr-front-end-qa --service sfr-front-end-qa --force-new-deployment \ No newline at end of file + - name: Force ECS Update + run: | + aws ecs update-service --cluster sfr-front-end-qa --service sfr-front-end-qa --force-new-deployment \ No newline at end of file