diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ba71b8..f1cdb52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,40 +1,26 @@ -name: deploy +name: Build on: push: branches: - main - paths-ignore: - - '**.md' + jobs: build: + name: Build runs-on: ubuntu-latest - steps: - - name: Install & Build - uses: actions/checkout@v2 - - run: yarn install --frozen-lockfile - - run: yarn build && yarn install --production --ignore-scripts --prefer-offline - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + - uses: actions/checkout@v2 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: Build, tag, and push image to Amazon ECR - id: build-image + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: sonarsource/sonarqube-scan-action@master env: - ECR_REGISTRY: 600453241670.dkr.ecr.us-east-1.amazonaws.com - ECR_REPOSITORY: next-docker - IMAGE_TAG: latest - run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + # If you wish to fail your job when the Quality Gate is red, uncomment the + # following lines. This would typically be used to fail a deployment. + # - uses: sonarsource/sonarqube-quality-gate-action@master + # timeout-minutes: 5 + # env: + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..4281588 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=f-bguiga_next-docker_AY-fTHoRfukTexZf2BjO \ No newline at end of file