diff --git a/.github/disabled-workflows/foss-release-image-publish.yml b/.github/disabled-workflows/foss-release-image-publish.yml index 049589f3eea..52c3e1db2e3 100644 --- a/.github/disabled-workflows/foss-release-image-publish.yml +++ b/.github/disabled-workflows/foss-release-image-publish.yml @@ -14,9 +14,6 @@ jobs: runs-on: ubuntu-20.04 # TODO: Don't sync until ee code relocation is done if: ${{false}} - permissions: - contents: read - id-token: write steps: - name: Checkout default branch if: github.repository == 'PostHog/posthog-foss' @@ -30,9 +27,13 @@ jobs: if: github.repository == 'PostHog/posthog-foss' run: echo "GIT_SHA = '${GITHUB_SHA}'" > posthog/gitsha.py - - name: Set up Depot CLI + - name: Set up QEMU if: github.repository == 'PostHog/posthog-foss' - uses: depot/setup-action@v1 + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + if: github.repository == 'PostHog/posthog-foss' + uses: docker/setup-buildx-action@v1 - name: Login to DockerHub if: github.repository == 'PostHog/posthog-foss' @@ -44,7 +45,7 @@ jobs: - name: Build and push release if: github.repository == 'PostHog/posthog-foss' id: docker-release - uses: depot/build-push-action@v1 + uses: docker/build-push-action@v2 with: context: . push: true diff --git a/.github/workflows/build-and-deploy-prod.yml b/.github/workflows/build-and-deploy-prod.yml index c57ffcc2ff3..ef3fcc571f0 100644 --- a/.github/workflows/build-and-deploy-prod.yml +++ b/.github/workflows/build-and-deploy-prod.yml @@ -16,12 +16,7 @@ jobs: name: Build & Deploy Production Docker image if: github.repository == 'PostHog/posthog' runs-on: ubuntu-20.04 - permissions: - contents: read - id-token: write steps: - - name: Set up Depot CLI - uses: depot/setup-action@v1 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -46,23 +41,14 @@ jobs: # ref: 'master' path: 'deploy/' - - name: Build image - uses: depot/build-push-action@v1 - with: - context: . - file: prod.web.Dockerfile - load: true - tags: | - ${{ steps.login-ecr.outputs.registry }}/posthog-production:${{ github.sha }} - ${{ steps.login-ecr.outputs.registry }}/posthog-production:latest - - - name: Push image to Amazon ECR + - name: Build, tag, and push image to Amazon ECR id: build-image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: posthog-production IMAGE_TAG: ${{ github.sha }} run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f prod.web.Dockerfile . docker push --all-tags $ECR_REGISTRY/$ECR_REPOSITORY echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" diff --git a/.github/workflows/docker-image-publish.yml b/.github/workflows/docker-image-publish.yml index b8d344e584f..a51c8015069 100644 --- a/.github/workflows/docker-image-publish.yml +++ b/.github/workflows/docker-image-publish.yml @@ -13,9 +13,6 @@ jobs: name: Build Docker images and push them if: github.repository == 'PostHog/posthog' runs-on: ubuntu-20.04 - permissions: - contents: read - id-token: write steps: - name: Checkout default branch uses: actions/checkout@v2 @@ -23,10 +20,16 @@ jobs: - name: Update git sha run: echo "GIT_SHA = '${GITHUB_SHA}'" >posthog/gitsha.py - - name: Set up Depot CLI - uses: depot/setup-action@v1 + - name: Set up QEMU + if: github.repository == 'PostHog/posthog' + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + if: github.repository == 'PostHog/posthog' + uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: github.repository == 'PostHog/posthog' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -34,7 +37,8 @@ jobs: - name: Build and push latest id: docker-latest - uses: depot/build-push-action@v1 + if: github.repository == 'PostHog/posthog' + uses: docker/build-push-action@v2 with: context: . push: true @@ -42,7 +46,8 @@ jobs: - name: Build and push dev id: docker-dev - uses: depot/build-push-action@v1 + if: github.repository == 'PostHog/posthog' + uses: docker/build-push-action@v2 with: context: . file: dev.Dockerfile @@ -50,6 +55,7 @@ jobs: tags: posthog/posthog:dev - name: Image digests + if: github.repository == 'PostHog/posthog' run: | echo "Pushed latest: ${{ steps.docker-latest.outputs.digest }}" echo "Pushed dev: ${{ steps.docker-dev.outputs.digest }}" diff --git a/.github/workflows/docker-release-image-publish.yml b/.github/workflows/docker-release-image-publish.yml index 4affca91165..a4518cfacd1 100644 --- a/.github/workflows/docker-release-image-publish.yml +++ b/.github/workflows/docker-release-image-publish.yml @@ -10,11 +10,7 @@ on: jobs: build-push: name: Build & push Docker release image - if: github.repository == 'PostHog/posthog' runs-on: ubuntu-20.04 - permissions: - contents: read - id-token: write steps: - name: Checkout default branch uses: actions/checkout@v2 @@ -25,10 +21,16 @@ jobs: - name: Update git SHA run: echo "GIT_SHA = '${GITHUB_SHA}'" > posthog/gitsha.py - - name: Set up Depot CLI - uses: depot/setup-action@v1 + - name: Set up QEMU + if: github.repository == 'PostHog/posthog' + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + if: github.repository == 'PostHog/posthog' + uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: github.repository == 'PostHog/posthog' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -36,7 +38,8 @@ jobs: - name: Build and push release id: docker-release - uses: depot/build-push-action@v1 + if: github.repository == 'PostHog/posthog' + uses: docker/build-push-action@v2 with: context: . push: true @@ -45,5 +48,6 @@ jobs: posthog/posthog:release-${{ env.TAG_NAME }} - name: Image digest + if: github.repository == 'PostHog/posthog' run: | echo "Pushed release: ${{ steps.docker-release.outputs.digest }}" diff --git a/.github/workflows/docker-unstable-image.yml b/.github/workflows/docker-unstable-image.yml index 5fc3dfd1025..813a95b0a3e 100644 --- a/.github/workflows/docker-unstable-image.yml +++ b/.github/workflows/docker-unstable-image.yml @@ -12,9 +12,6 @@ jobs: name: Build & push Docker release image if: github.repository == 'PostHog/posthog' runs-on: ubuntu-20.04 - permissions: - contents: read - id-token: write steps: - name: Checkout default branch uses: actions/checkout@v2 @@ -25,10 +22,16 @@ jobs: - name: Update git SHA run: echo "GIT_SHA = '${GITHUB_SHA}'" > posthog/gitsha.py - - name: Set up Depot CLI - uses: depot/setup-depot@v1 + - name: Set up QEMU + if: github.repository == 'PostHog/posthog' + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + if: github.repository == 'PostHog/posthog' + uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: github.repository == 'PostHog/posthog' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -36,12 +39,14 @@ jobs: - name: Build and push release id: docker-release - uses: depot/build-push-action@v1 + if: github.repository == 'PostHog/posthog' + uses: docker/build-push-action@v2 with: context: . push: true tags: posthog/posthog:${{ env.BRANCH_NAME }}-unstable - name: Image digest + if: github.repository == 'PostHog/posthog' run: | echo "Pushed release: ${{ steps.docker-release.outputs.digest }}" diff --git a/depot.json b/depot.json deleted file mode 100644 index 316dd6ef945..00000000000 --- a/depot.json +++ /dev/null @@ -1 +0,0 @@ -{ "id": "x19jffd9zf" }