Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-harvey committed Dec 27, 2023
1 parent 9d94c35 commit e8b095d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/reusable-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,33 @@ jobs:
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v2

- name: Create env var for docker tag
run: echo "TAG=$(date +%s)" >> "$GITHUB_ENV"

- name: Create env var for git sha tag
run: echo "HASH=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"

- name: Create env var for ECR repo
run: echo "ECR_REPOSITORY=security-hub-collector" >> "$GITHUB_ENV"

- name: Configure AWS Credentials
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

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build the Docker image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# for now, we're not using the latest tag since other consumers of this image are not yet ready to use it yet. We'll use the v2 tag for now.
run: docker build . --file Dockerfile --tag $ECR_REGISTRY/$ECR_REPOSITORY:${TAG} --tag $ECR_REGISTRY/$ECR_REPOSITORY:v2 --tag $ECR_REGISTRY/$ECR_REPOSITORY:${HASH}

- name: Push docker image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e8b095d

Please sign in to comment.