Skip to content

Commit

Permalink
Merge pull request #9 from dlcs/revert-8-feature/useEcrPublic
Browse files Browse the repository at this point in the history
Revert "Updating build to push to public ECR"
  • Loading branch information
JackLewis-digirati authored Nov 22, 2024
2 parents 20f73f7 + 367fc25 commit bf676b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
30 changes: 11 additions & 19 deletions .github/actions/docker-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ description: Composite GitHub Action to build and push Docker images to the DLCS

inputs:
image-name:
description: "Name of the image to push to the ECR repository."
description: "Name of the image to push to the GHCR repository."
required: true
dockerfile:
description: "The DockerFile to build and push."
description: "The EntityCounterDockerfile to build and push."
required: true
context:
description: "The context to use when building the Dockerfile."
description: "The context to use when building the EntityCounterDockerfile."
required: true
ecr-role:
description: "The name of the role to log into ECR with"
github-token:
description: "The GitHub token used when interacting with GCHR."
required: true

runs:
Expand All @@ -22,31 +22,23 @@ runs:
uses: actions/checkout@v3
- id: docker-setup-buildx
uses: docker/setup-buildx-action@v2

- id: docker-meta
uses: docker/metadata-action@v4
with:
images: public.ecr.aws/j8m2g9d5/${{ inputs.image-name }}
images: ghcr.io/dlcs/${{ inputs.image-name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,enable=true,prefix=,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- id: configure-aws-creds
uses: aws-actions/configure-aws-credentials@v4
- id: docker-login
uses: docker/login-action@v2
with:
role-to-assume: ${{ inputs.ecr-role }}
aws-region: us-east-1

- id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
mask-password: 'true'

registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.github-token }}
- id: docker-build-push
uses: docker/build-push-action@v4
with:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ on:
- "terraform/**"
- "sql/**"

permissions:
id-token: write # required for OIDC / AWS
contents: read # This is required for actions/checkout

jobs:
test-entity-counter-recalculator:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,10 +51,10 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "dlcservices-entity-counter-recalculator"
image-name: "entity-counter-recalculator"
dockerfile: "src/EntityCounterDockerfile"
context: "./src"
ecr-role: ${{ secrets.ECR_ROLE }}
github-token: ${{ secrets.GITHUB_TOKEN }}

build-push-dlcs-customer-storage-recalculator:
runs-on: ubuntu-latest
Expand All @@ -67,7 +63,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/docker-build-and-push
with:
image-name: "dlcservices-customer-storage-recalculator"
image-name: "customer-storage-recalculator"
dockerfile: "src/CustomerStorageDockerfile"
context: "./src"
ecr-role: ${{ secrets.ECR_ROLE }}
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bf676b7

Please sign in to comment.