diff --git a/.github/workflows/container-image.yaml b/.github/workflows/container-image.yaml index 0bb5db4767..bb725c9de8 100644 --- a/.github/workflows/container-image.yaml +++ b/.github/workflows/container-image.yaml @@ -6,7 +6,6 @@ on: jobs: buildx: # this is to prevent the job to run at forked projects - if: github.repository == 'kubernetes-sigs/aws-ebs-csi-driver' env: IMAGE: aws-ebs-csi-driver DEB_BUILD_TAG: aws-ebs-csi-driver:debian @@ -27,13 +26,13 @@ jobs: --platform=linux/arm64,linux/amd64 \ --output="type=image,push=false" . \ --target=debian-base - - name: Build amazonlinux target - run: | - docker buildx build \ - -t $AL2_BUILD_TAG \ - --platform=linux/arm64,linux/amd64 \ - --output="type=image,push=false" . \ - --target=amazonlinux + # - name: Build amazonlinux target + # run: | + # docker buildx build \ + # -t $AL2_BUILD_TAG \ + # --platform=linux/arm64,linux/amd64 \ + # --output="type=image,push=false" . \ + # --target=amazonlinux - name: Set environment variables run: | BRANCH=$(echo $GITHUB_REF | cut -d'/' -f3) @@ -44,16 +43,23 @@ jobs: TAG=$BRANCH fi echo "TAG=$TAG" >> $GITHUB_ENV - - name: Login to Docker Hub - uses: docker/login-action@v1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push amazonlinux target to Docker Hub + aws-access-key-id: ${{ secrets.GH_ACTIONS_AWS_KEY_ID }} + aws-secret-access-key: ${{ secrets.GH_ACTIONS_SECRET_ACCESS_KEY }} + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }} + role-duration-seconds: 1200 + role-session-name: GitHubActions + aws-region: us-east-1 + - name: log-in to ECR + run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 204717343847.dkr.ecr.us-east-1.amazonaws.com + - name: Push debian target to Docker Hub run: | - AL2_PUSH_TAG="amazon/$IMAGE:$TAG-amazonlinux" + DEB_PUSH_TAG="204717343847.dkr.ecr.us-east-1.amazonaws.com/infura-dedicated/$IMAGE:$TAG" docker buildx build \ - -t $AL2_PUSH_TAG \ + -t $DEB_PUSH_TAG \ --platform=linux/arm64,linux/amd64 \ --output="type=image,push=true" . \ - --target=amazonlinux + --target=debian-base