Skip to content

Commit

Permalink
Remove redundancy in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpotts committed Jan 15, 2024
1 parent edf0301 commit f281e6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
end_of_line = lf
tab_width = 2
indent_style = tab

[*.yml]
indent_style = space
37 changes: 2 additions & 35 deletions .github/workflows/babelfish-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ name: Build and Push Babelfish Updates
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:

check:

runs-on: ubuntu-latest

outputs:
Expand All @@ -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
8 changes: 6 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f281e6a

Please sign in to comment.