From 0172523f10fa99fed5207d7d6ed13d4f58eda143 Mon Sep 17 00:00:00 2001 From: Mostafa Abdelraouf Date: Thu, 16 Feb 2023 20:31:53 -0600 Subject: [PATCH] Build Dockerfile.ci using Github workflows (#325) We have to build and push the docker image used in CI manually. This PR builds that image automatically and pushes it to Github docker repository. Will start using that image in a follow PR --- .github/workflows/publish-ci-docker-image.yml | 20 +++++++++++++++++++ Dockerfile.ci | 16 ++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/publish-ci-docker-image.yml diff --git a/.github/workflows/publish-ci-docker-image.yml b/.github/workflows/publish-ci-docker-image.yml new file mode 100644 index 0000000..3cae8e7 --- /dev/null +++ b/.github/workflows/publish-ci-docker-image.yml @@ -0,0 +1,20 @@ +name: publish-ci-docker-image +on: + push: + branches: [ main ] +jobs: + publish-ci-docker-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build CI Docker image + run: | + docker build . -f Dockerfile.ci --tag ghcr.io/levkk/pgcat-ci:latest + docker run ghcr.io/levkk/pgcat-ci:latest + docker push ghcr.io/levkk/pgcat-ci:latest diff --git a/Dockerfile.ci b/Dockerfile.ci index d8febbb..71d3d73 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,10 +1,12 @@ FROM cimg/rust:1.62.0 RUN sudo apt-get update && \ - sudo apt-get install -y psmisc postgresql-contrib-12 postgresql-client-12 ruby ruby-dev libpq-dev python3 python3-pip lcov llvm-11 && \ - sudo apt-get upgrade curl -RUN cargo install cargo-binutils rustfilt && \ - rustup component add llvm-tools-preview -RUN pip3 install psycopg2 && \ - sudo gem install bundler -RUN wget -O toxiproxy-2.4.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.4.0/toxiproxy_2.4.0_linux_$(dpkg --print-architecture).deb && \ + sudo apt-get install -y \ + postgresql-contrib-12 postgresql-client-12 libpq-dev \ + ruby ruby-dev python3 python3-pip \ + lcov llvm-11 iproute2 && \ + sudo apt-get upgrade curl && \ + cargo install cargo-binutils rustfilt && \ + rustup component add llvm-tools-preview && \ + pip3 install psycopg2 && sudo gem install bundler && \ + wget -O toxiproxy-2.4.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.4.0/toxiproxy_2.4.0_linux_$(dpkg --print-architecture).deb && \ sudo dpkg -i toxiproxy-2.4.0.deb