From f281e6a9c250401760fcbefd18afacffa473e495 Mon Sep 17 00:00:00 2001 From: Jonathan Potts Date: Mon, 15 Jan 2024 10:10:00 -0600 Subject: [PATCH] Remove redundancy in workflows --- .editorconfig | 3 ++ .github/workflows/babelfish-updates.yml | 37 ++----------------------- .github/workflows/docker-image.yml | 8 ++++-- 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/.editorconfig b/.editorconfig index 91a9f92..3239b97 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,3 +2,6 @@ end_of_line = lf tab_width = 2 indent_style = tab + +[*.yml] +indent_style = space diff --git a/.github/workflows/babelfish-updates.yml b/.github/workflows/babelfish-updates.yml index a9ede15..d779af2 100644 --- a/.github/workflows/babelfish-updates.yml +++ b/.github/workflows/babelfish-updates.yml @@ -3,12 +3,9 @@ name: Build and Push Babelfish Updates on: schedule: - cron: '0 0 * * *' - workflow_dispatch: jobs: - check: - runs-on: ubuntu-latest outputs: @@ -31,35 +28,5 @@ jobs: echo "Docker Hub tag exists: $DOCKERHUB_TAG_EXISTS" build: - - needs: check - if: needs.check.outputs.dockerhub_tag_exists == 'false' - - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build and Push Docker image - uses: docker/build-push-action@v5 - with: - platforms: linux/amd64,linux/arm64 - tags: | - jonathanpotts/babelfishpg:${{ needs.check.outputs.babelfish_tag }} - jonathanpotts/babelfishpg:latest - build-args: - BABELFISH_VERSION=${{ needs.check.outputs.babelfish_tag }} - push: true + uses: ./.github/workflows/docker-image.yml + secrets: inherit diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b4ba0c7..3e96ec9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,11 +6,15 @@ on: pull_request: branches: [ "main" ] workflow_dispatch: + workflow_call: + secrets: + DOCKER_USERNAME: + required: true + DOCKER_TOKEN: + required: true jobs: - build: - runs-on: ubuntu-latest steps: