From 8fabb701bf64aad1864db79163926b5b5a5b1ae8 Mon Sep 17 00:00:00 2001 From: Joshua Lockerman Date: Fri, 6 May 2022 11:55:19 -0400 Subject: [PATCH] Allow building CI image in Actions This commit adds a GitHub action to build and deploy our CI image. This will any of us to rebuild and deploy the CI image, and test it better before deployment. --- .github/workflows/ci_image_build.yml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci_image_build.yml diff --git a/.github/workflows/ci_image_build.yml b/.github/workflows/ci_image_build.yml new file mode 100644 index 000000000..d91cc14fd --- /dev/null +++ b/.github/workflows/ci_image_build.yml @@ -0,0 +1,56 @@ +name: Build CI Image + +on: + pull_request: + paths: + - 'docker/ci/**' + - '.github/workflows/ci_image_build.yml' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-ci-buildx-debian-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-ci-buildx-debian + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build + uses: docker/build-push-action@v2 + with: + push: false + load: true + context: . + file: ./docker/ci/Dockerfile + tags: timescaledev/rust-pgx:latest + + - name: Push + id: image_build + uses: docker/build-push-action@v2 + with: + push: ${{ github.event_name == 'workflow_dispatch' }} + context: . + file: ./docker/ci/Dockerfile + tags: timescaledev/rust-pgx:latest + + - name: Image digest + run: echo ${{ steps.image_build.outputs.digest }}