From 0dad5097f39b2f06bdbbc66d19e6789f838515d3 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sat, 8 Feb 2025 21:30:41 -0800 Subject: [PATCH] Update CI to deduplicate steps (don't build and push twice per version) and if on main, push to Docker Hub --- .../continuous-integration-workflow.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index b718db9..c6a789c 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -1,8 +1,5 @@ -name: Build and Test - -on: - [push, pull_request] - +name: CI +on: push jobs: ci: runs-on: ubuntu-latest @@ -91,3 +88,16 @@ jobs: env: CI_VERSION: ${{ matrix.version }} SKIP_CLEANUP: 1 + + - name: Login to Docker Hub + if: ${{ github.ref == 'refs/heads/main' }} + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PERSONAL_ACCESS_TOKEN }} + + - name: Push Docker image + if: ${{ github.ref == 'refs/heads/main' }} + run: ./push.sh + env: + CI_VERSION: ${{ matrix.version }}