Skip to content

Commit

Permalink
workflow: deprecate ecr image publication
Browse files Browse the repository at this point in the history
  • Loading branch information
gian2dchris committed Nov 2, 2022
1 parent f22de5e commit 90cd633
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on:
- 'Dockerfile'
workflow_dispatch:

env:
AWS_REGION: eu-central-1 # set this to your preferred AWS region, e.g. us-west-1

permissions:
contents: read

Expand All @@ -41,20 +38,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@master

- name: Configure AWS credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.ASSUME_ROLE }}
role-duration-seconds: 900
aws-region: ${{ env.AWS_REGION }}

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

- name: Login to GitHub Container Registry
id: login-ghcr
uses: docker/login-action@v2
Expand All @@ -67,12 +50,10 @@ jobs:
id: meta
uses: docker/metadata-action@v4
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: aws-lambda-secrets-extension
GHCR_REPOSITORY: aws-lambda-secrets-extension
with:
images: |
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
ghcr.io/${{ github.repository }}
ghcr.io/${{ env.GHCR_REPOSITORY }}
- name: Set Release Tag
id: tag
Expand All @@ -85,17 +66,14 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v2
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: aws-lambda-secrets-extension
GHCR_REPOSITORY: aws-lambda-secrets-extension
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: |
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.TAG }}
ghcr.io/${{ github.repository_owner }}/${{ env.ECR_REPOSITORY }}:latest
ghcr.io/${{ github.repository_owner }}/${{ env.ECR_REPOSITORY }}:${{ env.TAG }}
ghcr.io/${{ github.repository_owner }}/${{ env.GHCR_REPOSITORY }}:latest
ghcr.io/${{ github.repository_owner }}/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 90cd633

Please sign in to comment.