perf: Optimize workflow step order for efficiency

Reorder steps to check what's needed first, then only set up Docker environment if build is actually required. This avoids expensive Docker setup when only label changes occur.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-08-23 17:05:07 -07:00
parent 390da591b1
commit e2a9e28313

View File

@@ -89,26 +89,7 @@ jobs:
echo "deploy_needed=$DEPLOY" >> $GITHUB_OUTPUT
echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT
- name: Checkout repository for local actions
if: steps.check.outputs.build_needed == 'true'
uses: actions/checkout@v4
with:
fetch-depth: 1
persist-credentials: false
- name: Setup Docker Environment
if: steps.check.outputs.build_needed == 'true'
uses: ./.github/actions/setup-docker
with:
dockerhub-user: ${{ env.DOCKERHUB_USER }}
dockerhub-token: ${{ env.DOCKERHUB_TOKEN }}
build: "true"
- name: Setup supersetbot
if: steps.check.outputs.build_needed == 'true'
uses: ./.github/actions/setup-supersetbot/
- name: Get PR SHA for build
- name: Get SHA for potential build
id: sha
if: steps.check.outputs.build_needed == 'true'
run: |
@@ -140,8 +121,21 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ steps.sha.outputs.build_sha }}
fetch-depth: 1
persist-credentials: false
- name: Setup Docker Environment
if: steps.check.outputs.build_needed == 'true'
uses: ./.github/actions/setup-docker
with:
dockerhub-user: ${{ env.DOCKERHUB_USER }}
dockerhub-token: ${{ env.DOCKERHUB_TOKEN }}
build: "true"
- name: Setup supersetbot
if: steps.check.outputs.build_needed == 'true'
uses: ./.github/actions/setup-supersetbot/
- name: Build Docker image
if: steps.check.outputs.build_needed == 'true'
run: |