diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d16d221cc4..d479201305 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -551,6 +551,48 @@ jobs: - name: Cleanup ECR folder run: rm -rf ~/.ecr + + neon-image-depot: + # For testing this will run side-by-side for a few merges. + # This action is not really optimized yet, but gets the job done + runs-on: [ self-hosted, gen3, small ] + needs: [ tag ] + container: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/base:pinned + permissions: + contents: read + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Setup go + uses: actions/setup-go@v3 + with: + go-version: '1.19' + + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Install Crane & ECR helper + run: go install github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login@69c85dc22db6511932bbf119e1a0cc5c90c69a7f # v0.6.0 + + - name: Configure ECR login + run: | + mkdir /github/home/.docker/ + echo "{\"credsStore\":\"ecr-login\"}" > /github/home/.docker/config.json + + - name: Build and push + uses: depot/build-push-action@v1 + with: + # if no depot.json file is at the root of your repo, you must specify the project id + project: nrdv0s4kcs + push: true + tags: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/neon:depot-${{needs.tag.outputs.build-tag}} + compute-tools-image: runs-on: [ self-hosted, gen3, large ] needs: [ tag ] diff --git a/Dockerfile b/Dockerfile index 0d5ba73456..6f7d2c32a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ ARG CACHEPOT_BUCKET=neon-github-dev COPY --from=pg-build /home/nonroot/pg_install/v14/include/postgresql/server pg_install/v14/include/postgresql/server COPY --from=pg-build /home/nonroot/pg_install/v15/include/postgresql/server pg_install/v15/include/postgresql/server -COPY . . +COPY --chown=nonroot . . # Show build caching stats to check if it was used in the end. # Has to be the part of the same RUN since cachepot daemon is killed in the end of this RUN, losing the compilation stats.