Skip to content

Commit

Permalink
Build Dockerfile.ci using Github workflows (#325)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
drdrsh authored Feb 17, 2023
1 parent c69f461 commit 0172523
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish-ci-docker-image.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 9 additions & 7 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0172523

Please sign in to comment.