Skip to content

Commit

Permalink
Use depot
Browse files Browse the repository at this point in the history
  • Loading branch information
danielxnj committed Nov 29, 2023
1 parent ab432cd commit e15cc66
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@ jobs:
path: posthog

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
Expand All @@ -45,15 +57,25 @@ jobs:
id: aws-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and push
uses: docker/build-push-action@v5
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# push: true
# tags: ${{ steps.aws-ecr.outputs.registry }}/pr-test:${{ github.event.pull_request.head.sha }}
# build-args: COMMIT_HASH=${{ github.event.pull_request.head.sha }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# platforms: linux/amd64,linux/arm64

- name: Build and push unit container image
id: build-unit
uses: depot/build-push-action@v1
with:
push: true
tags: ${{ steps.aws-ecr.outputs.registry }}/pr-test:${{ github.event.pull_request.head.sha }}
build-args: COMMIT_HASH=${{ github.event.pull_request.head.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
buildx-fallback: false # the fallback is so slow it's better to just fail
push: true
tags: ${{ steps.aws-ecr.outputs.registry }}/pr-test:${{ github.event.pull_request.head.sha }}
platforms: linux/arm64,linux/amd64
build-args: COMMIT_HASH=${{ github.event.pull_request.head.sha }}

- name: start deployment
uses: bobheadxi/[email protected]
Expand Down

0 comments on commit e15cc66

Please sign in to comment.