Skip to content

Commit

Permalink
another fix
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Heinrich <[email protected]>
  • Loading branch information
andistorm committed Jul 5, 2024
1 parent 50ec115 commit fd15e3f
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/deploy-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,93 +18,97 @@ env:
DOCKER_DIRECTORY: docker/images/

jobs:
evaluate-force-rebuild:
name: Evaluate force rebuild
env-setup:
# Since env variables can't be passed to reusable workflows, we need to pass them as outputs
name: Evaluate force rebuild and set env variables as outputs
runs-on: ubuntu-22.04
outputs:
force_rebuild: ${{ steps.check.outputs.force_rebuild }}
docker_registry: ${{ steps.check.outputs.docker_registry }}
docker_directory: ${{ steps.check.outputs.docker_directory }}
steps:
- name: Evaluate force rebuild
id: check
run:
- id: check
run: |
echo "force_rebuild=${{ inputs.force_rebuild || (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/' )) || false }}" >> $GITHUB_OUTPUT
echo "docker_registry=${{ env.REGISTRY }}" >> $GITHUB_OUTPUT
echo "docker_directory=${{ env.DOCKER_DIRECTORY }}" >> $GITHUB_OUTPUT
# One job for each image, since the images build on top of each other a matrix strategy is not possible
everest-clang-format:
needs:
- evaluate-force-rebuild
- env-setup
name: Build and push everest-clang-format docker image
uses: ./.github/workflows/deploy-single-docker-image.yml
secrets:
SA_GITHUB_PAT: ${{ secrets.SA_GITHUB_PAT }}
SA_GITHUB_USERNAME: ${{ secrets.SA_GITHUB_USERNAME }}
with:
force_rebuild: ${{ needs.evaluate-force-rebuild.outputs.force_rebuild == 'true' }}
force_rebuild: ${{ needs.env-setup.outputs.force_rebuild == 'true' }}
image_name: everest-clang-format
docker_directory: ${{ github.env.DOCKER_DIRECTORY }}
docker_registry: ${{ github.env.REGISTRY }}
docker_directory: ${{ needs.env-setup.outputs.docker_directory }}
docker_registry: ${{ needs.env-setup.outputs.docker_registry }}
github_ref_before: ${{ github.event.before }}
github_ref_after: ${{ github.event.after }}
run-env-base:
needs:
- evaluate-force-rebuild
- env-setup
name: Build and push run-env-base docker image
uses: ./.github/workflows/deploy-single-docker-image.yml
secrets:
SA_GITHUB_PAT: ${{ secrets.SA_GITHUB_PAT }}
SA_GITHUB_USERNAME: ${{ secrets.SA_GITHUB_USERNAME }}
with:
force_rebuild: ${{ needs.evaluate-force-rebuild.outputs.force_rebuild == 'true' }}
force_rebuild: ${{ needs.env-setup.outputs.force_rebuild == 'true' }}
image_name: run-env-base
docker_directory: ${{ github.env.DOCKER_DIRECTORY }}
docker_registry: ${{ github.env.REGISTRY }}
docker_directory: ${{ needs.env-setup.outputs.docker_directory }}
docker_registry: ${{ needs.env-setup.outputs.docker_registry }}
github_ref_before: ${{ github.event.before }}
github_ref_after: ${{ github.event.after }}
build-env-base:
needs:
- evaluate-force-rebuild
- env-setup
- run-env-base
name: Build and push build-env-base docker image
uses: ./.github/workflows/deploy-single-docker-image.yml
secrets:
SA_GITHUB_PAT: ${{ secrets.SA_GITHUB_PAT }}
SA_GITHUB_USERNAME: ${{ secrets.SA_GITHUB_USERNAME }}
with:
force_rebuild: ${{ needs.evaluate-force-rebuild.outputs.force_rebuild == 'true' }}
force_rebuild: ${{ needs.env-setup.outputs.force_rebuild == 'true' }}
image_name: build-env-base
docker_directory: ${{ github.env.DOCKER_DIRECTORY }}
docker_registry: ${{ github.env.REGISTRY }}
docker_directory: ${{ needs.env-setup.outputs.docker_directory }}
docker_registry: ${{ needs.env-setup.outputs.docker_registry }}
github_ref_before: ${{ github.event.before }}
github_ref_after: ${{ github.event.after }}
dev-env-base:
needs:
- evaluate-force-rebuild
- env-setup
- build-env-base
name: Build and push dev-env-base docker image
uses: ./.github/workflows/deploy-single-docker-image.yml
secrets:
SA_GITHUB_PAT: ${{ secrets.SA_GITHUB_PAT }}
SA_GITHUB_USERNAME: ${{ secrets.SA_GITHUB_USERNAME }}
with:
force_rebuild: ${{ needs.evaluate-force-rebuild.outputs.force_rebuild == 'true' }}
force_rebuild: ${{ needs.env-setup.outputs.force_rebuild == 'true' }}
image_name: dev-env-base
docker_directory: ${{ github.env.DOCKER_DIRECTORY }}
docker_registry: ${{ github.env.REGISTRY }}
docker_directory: ${{ needs.env-setup.outputs.docker_directory }}
docker_registry: ${{ needs.env-setup.outputs.docker_registry }}
github_ref_before: ${{ github.event.before }}
github_ref_after: ${{ github.event.after }}
build-kit:
needs:
- evaluate-force-rebuild
- env-setup
- build-env-base
name: Build and push build-kit docker image
uses: ./.github/workflows/deploy-single-docker-image.yml
secrets:
SA_GITHUB_PAT: ${{ secrets.SA_GITHUB_PAT }}
SA_GITHUB_USERNAME: ${{ secrets.SA_GITHUB_USERNAME }}
with:
force_rebuild: ${{ needs.evaluate-force-rebuild.outputs.force_rebuild == 'true' }}
force_rebuild: ${{ needs.env-setup.outputs.force_rebuild == 'true' }}
image_name: build-kit
docker_directory: ${{ github.env.DOCKER_DIRECTORY }}
docker_registry: ${{ github.env.REGISTRY }}
docker_directory: ${{ needs.env-setup.outputs.docker_directory }}
docker_registry: ${{ needs.env-setup.outputs.docker_registry }}
github_ref_before: ${{ github.event.before }}
github_ref_after: ${{ github.event.after }}

0 comments on commit fd15e3f

Please sign in to comment.