Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-fleming authored Oct 18, 2024
1 parent 09b1462 commit cfc5f0e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: actions/checkout@v2

- name: Set Image Tag
id: set-tag
run: |
# Get all tags for the repo and find the latest tag for the branch being built
git fetch --tags --force --quiet
Expand All @@ -41,6 +42,7 @@ jobs:
fi
- name: Build
id: build-image
run: |
docker build -t $ECR_REPOSITORY:$IMAGE_TAG .
Expand All @@ -54,6 +56,7 @@ jobs:
fi
- name: Run Trivy vulnerability scanner
id: trivy-scan
uses: aquasecurity/trivy-action@0.20.0
with:
image-ref: '${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}'
Expand All @@ -62,18 +65,8 @@ jobs:
ignore-unfixed: true
severity: 'CRITICAL,HIGH'

# - name: Create Git tag for Image
# uses: actions/github-script@v4
# with:
# script: |
# github.git.createRef({
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: "refs/tags/${{ env.IMAGE_TAG }}",
# sha: context.sha
# })

- name: Create Git tag for Image
id: tag-repo
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
Expand All @@ -93,6 +86,7 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1

- name: Push to Amazon ECR
id: push-image
env:
ECR_REGISTRY: ${{ steps.login-aws-ecr.outputs.registry }}
run: |
Expand Down

0 comments on commit cfc5f0e

Please sign in to comment.