Convert repository names to lowercase before referring to them as docker names. #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "clp-execution-image-build" | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/clp-execution-image-build.yaml" | |
- "components/core/tools/scripts/lib_install/*" | |
- "tools/docker-images/clp-execution-base-focal/**" | |
push: | |
paths: | |
- ".github/workflows/clp-execution-image-build.yaml" | |
- "components/core/tools/scripts/lib_install/*" | |
- "tools/docker-images/clp-execution-base-focal/**" | |
workflow_dispatch: | |
env: | |
CONTAINER_IMAGE_REGISTRY: "ghcr.io" | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v3" | |
with: | |
submodules: "recursive" | |
- name: "Workaround actions/runner-images/issues/6775" | |
run: "chown $(id -u):$(id -g) -R ." | |
- uses: "docker/login-action@v3" | |
with: | |
registry: "${{env.CONTAINER_IMAGE_REGISTRY}}" | |
username: "${{github.actor}}" | |
password: "${{secrets.GITHUB_TOKEN}}" | |
- id: "sanitization" | |
shell: "bash" | |
run: | | |
# Docker doesn't support repository names with uppercase characters, so we convert the | |
# name to lowercase here. | |
echo "REPOSITORY=$(echo '${{github.repository}}' | tr '[:upper:]' '[:lower:]')" \ | |
>> "$GITHUB_OUTPUT" | |
- id: "meta" | |
uses: "docker/metadata-action@v5" | |
with: | |
images: "${{env.CONTAINER_IMAGE_REGISTRY}}/${{steps.sanitization.REPOSITORY}}\ | |
/clp-execution-x86-ubuntu-focal" | |
- if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'" | |
uses: "docker/build-push-action@v5" | |
with: | |
context: "./" | |
file: "./tools/docker-images/clp-execution-base-focal/Dockerfile" | |
push: true | |
tags: "${{steps.meta.outputs.tags}}" | |
labels: "${{steps.meta.outputs.labels}}" |