From fc649d8034f66fa5ecfc46141cd9294fe76e375a Mon Sep 17 00:00:00 2001 From: Bryan Ciaraldi Date: Wed, 20 Nov 2024 10:52:10 -0800 Subject: [PATCH] push image --- .github/workflows/container-images-ci.yml | 25 +++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/container-images-ci.yml b/.github/workflows/container-images-ci.yml index c690c11dd26..d85be699eaa 100644 --- a/.github/workflows/container-images-ci.yml +++ b/.github/workflows/container-images-ci.yml @@ -12,7 +12,7 @@ concurrency: jobs: posthog_build: - name: Build Docker image + name: Build and Push Docker Image to ECR runs-on: ubuntu-latest permissions: id-token: write # allow issuing OIDC tokens for this workflow run @@ -37,10 +37,27 @@ jobs: - name: Check out uses: actions/checkout@v3 - - name: Build and cache Docker image in Depot - uses: ./.github/actions/build-n-cache-image + # Configure AWS credentials + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 with: - actions-id-token-request-url: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Login to Amazon ECR + id: aws-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push container image + id: build + uses: depot/build-push-action@v1 + with: + buildx-fallback: false # the fallback is so slow it's better to just fail + push: true + tags: ${{ steps.aws-ecr.outputs.registry }}/posthog-cloud:${{ github.sha }} + platforms: linux/arm64,linux/amd64 + build-args: COMMIT_HASH=${{ github.sha }} deploy_preview: name: Deploy preview environment