Skip to content

Commit

Permalink
Merge pull request #98 from SpecterOps/steve/bi-1102/tag-push-ecr
Browse files Browse the repository at this point in the history
BI-1102: Retag and push image to private ECR registry
  • Loading branch information
hairlesshobo authored Jan 13, 2025
2 parents 0a2eb6f + 3e37de6 commit 00c7a01
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
push: ${{ ! startsWith(github.event_name, 'pull_request') }}

- name: Configure AWS credentials
if: ${{ ! startsWith(github.event_name, 'pull_request') }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'

- name: Login to Amazon ECR
if: ${{ ! startsWith(github.event_name, 'pull_request') }}
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Retag and push image to Amazon ECR
if: ${{ ! startsWith(github.event_name, 'pull_request') }}
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: production/azurehound
IMAGE_TAG: 'edge'
run: |
docker image tag ghcr.io/bloodhoundad/azurehound:edge $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
build:
runs-on: ubuntu-latest
defaults:
Expand Down

0 comments on commit 00c7a01

Please sign in to comment.