Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Jul 8, 2024
1 parent c5ae3ee commit e99c1a7
Showing 1 changed file with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ concurrency:
permissions: read-all

jobs:
skip_push:
name: Set skip_push if we are on a Pull Request
push:
name: Set push variable
runs-on: ubuntu-20.04
if: github.repository == 'vitessio/vitess'
outputs:
skip_push: ${{ steps.skip_push.outputs.skip_push }}
push: ${{ steps.push.outputs.push }}

steps:
- name: Set skip_push
id: skip_push
- name: Set push variable
id: push
run: |
push='false'
if [[ "${{github.event.pull_request}}" == "" ]]; then
push='true'
fi
echo Push='${push}'
echo "skip_push=${push}" >> $GITHUB_OUTPUT
echo "push=${push}" >> $GITHUB_OUTPUT
build_and_push_vttestserver:
name: Build and push vttestserver
runs-on: gh-hosted-runners-16cores-1
if: github.repository == 'vitessio/vitess' && needs.skip_push.result == 'success'
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success'
needs:
- skip_push
- push

strategy:
fail-fast: true
Expand All @@ -49,7 +49,7 @@ jobs:
uses: actions/checkout@v4

- name: Login to Docker Hub
if: needs.skip_push.outputs.skip_push == 'true'
if: needs.push.outputs.push == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -65,7 +65,7 @@ jobs:
with:
context: .
file: ${{ env.DOCKERFILE }}
push: ${{ needs.skip_push.outputs.skip_push }}
push: ${{ needs.push.outputs.push }}
tags: vitess/vttestserver:${{ matrix.branch }}

######
Expand Down Expand Up @@ -93,9 +93,9 @@ jobs:
build_and_push_lite:
name: Build and push lite
runs-on: gh-hosted-runners-16cores-1
if: github.repository == 'vitessio/vitess' && needs.skip_push.result == 'success'
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success'
needs:
- skip_push
- push

strategy:
fail-fast: true
Expand All @@ -107,7 +107,7 @@ jobs:
uses: actions/checkout@v4

- name: Login to Docker Hub
if: needs.skip_push.outputs.skip_push == 'true'
if: needs.push.outputs.push == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -127,7 +127,7 @@ jobs:
with:
context: .
file: ${{ env.DOCKERFILE }}
push: ${{ needs.skip_push.outputs.skip_push }}
push: ${{ needs.push.outputs.push }}
tags: vitess/lite:${{ matrix.branch }}

######
Expand Down Expand Up @@ -158,9 +158,9 @@ jobs:
build_and_push_components:
name: Build and push
runs-on: gh-hosted-runners-16cores-1
if: github.repository == 'vitessio/vitess' && needs.skip_push.result == 'success' && needs.build_and_push_lite.result == 'success'
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success' && needs.build_and_push_lite.result == 'success'
needs:
- skip_push
- push
- build_and_push_lite

strategy:
Expand All @@ -174,7 +174,7 @@ jobs:
uses: actions/checkout@v4

- name: Login to Docker Hub
if: needs.skip_push.outputs.skip_push == 'true'
if: needs.push.outputs.push == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -189,7 +189,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKER_CTX }}
push: ${{ needs.skip_push.outputs.skip_push }}
push: ${{ needs.push.outputs.push }}
tags: vitess/${{ matrix.component }}:latest
build-args: |
VT_BASE_VER=latest
Expand All @@ -200,7 +200,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKER_CTX }}
push: ${{ needs.skip_push.outputs.skip_push }}
push: ${{ needs.push.outputs.push }}
tags: vitess/${{ matrix.component }}:latest-${{ matrix.debian }}
build-args: |
VT_BASE_VER=latest
Expand Down

0 comments on commit e99c1a7

Please sign in to comment.