From 346730df3ad74b16a8ae7b6776c3446be9a1bac3 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Thu, 27 Jun 2024 10:42:11 +0100 Subject: [PATCH] WIP --- .github/workflows/build-env-docker.yml | 11 +++---- dev/Dockerfile.bindings | 40 +++++++++++++------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-env-docker.yml b/.github/workflows/build-env-docker.yml index b45cc746..1a165882 100644 --- a/.github/workflows/build-env-docker.yml +++ b/.github/workflows/build-env-docker.yml @@ -3,17 +3,18 @@ name: Create and publish a Docker image for bindings build environment -# Configures this workflow to run every time a change is pushed to the branch called `release`. on: push: branches: ['fix-docker-workflow'] -# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +concurrency: + group: docker-build + cancel-in-progress: true + env: REGISTRY: ghcr.io IMAGE_NAME: ghcr.io/sourcegraph/scip-bindings-env -# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: docker_release_build: runs-on: ubuntu-latest @@ -56,14 +57,14 @@ jobs: - name: Build and push by digest id: build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: file: dev/Dockerfile.bindings push: true platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true - cache-from: type=registry,ref=${{ env.IMAGE_NAME}}:main + cache-from: type=registry,ref=${{ env.IMAGE_NAME}}:latest cache-to: type=inline - name: Export digest diff --git a/dev/Dockerfile.bindings b/dev/Dockerfile.bindings index c5007db0..f0a79fbf 100644 --- a/dev/Dockerfile.bindings +++ b/dev/Dockerfile.bindings @@ -19,26 +19,26 @@ RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf && \ RUN . ~/.bashrc # YOLO -RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - -ENV PATH="${PATH}:/asdf/.ghcup/bin" - -RUN asdf plugin add nodejs && \ - asdf plugin add golang && \ - asdf plugin add shellcheck && \ - asdf plugin add yarn && \ - asdf plugin add python && \ - asdf plugin add rust - -COPY .tool-versions . - -RUN asdf install && \ - # Pre-fetch Haskell dependencies as they take the longest time by far - # TODO(anton): run the proto-generate.sh script during the build time to - # pre-fecth all dependencies. I attempted to do so but ran into issues - # with Yarn - cabal install proto-lens-protoc-0.8.0.1 ghc-source-gen-0.4.5.0 - +# RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh +# +# ENV PATH="${PATH}:/asdf/.ghcup/bin" +# +# RUN asdf plugin add nodejs && \ +# asdf plugin add golang && \ +# asdf plugin add shellcheck && \ +# asdf plugin add yarn && \ +# asdf plugin add python && \ +# asdf plugin add rust +# +# COPY .tool-versions . +# +# RUN asdf install && \ +# # Pre-fetch Haskell dependencies as they take the longest time by far +# # TODO(anton): run the proto-generate.sh script during the build time to +# # pre-fecth all dependencies. I attempted to do so but ran into issues +# # with Yarn +# cabal install proto-lens-protoc-0.8.0.1 ghc-source-gen-0.4.5.0 +# WORKDIR /src CMD ["./dev/docker-entrypoint.sh"]