Skip to content

Commit

Permalink
Merge pull request #2 from idirze/fix-build
Browse files Browse the repository at this point in the history
Convert github.repository_owner (OKDP) into lowercase
  • Loading branch information
idirze authored Feb 8, 2024
2 parents 82141ce + ce469d5 commit 55b1ad9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/docker-build-test-push-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ jobs:
username: ${{ secrets.registry_username }}
password: ${{ secrets.registry_token }}

- name: Lower github repository owner
run: echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_ENV
shell: bash

- name: Pull parent image 📥
if: inputs.parent-image != ''
run: docker pull ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.parent-image }}
run: docker pull ${{ inputs.registry }}/$OWNER/${{ inputs.parent-image }}
shell: bash

- name: Prepare image build (build args) 📦
Expand All @@ -70,7 +74,7 @@ jobs:
done
if [[ "${{ inputs.parent-image }}" ]]
then
BUILD_ARGS+="--build-arg BASE_CONTAINER=${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.parent-image }} "
BUILD_ARGS+="--build-arg BASE_CONTAINER=${{ inputs.registry }}/$OWNER/${{ inputs.parent-image }} "
fi
echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV
# The short image name is necessary to run the tests (not pushed, local to jobs only)
Expand All @@ -86,10 +90,10 @@ jobs:
- name: Build image 🛠
run: |
#docker buildx build --platform=linux/amd64 --rm --force-rm --tag ...
docker build --rm --force-rm --tag ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }} \
--tag ${{ inputs.registry }}/${{ github.repository_owner }}/$SHORT_IMAGE_NAME:latest images/$SHORT_IMAGE_NAME/ \
docker build --rm --force-rm --tag ${{ inputs.registry }}/$OWNER/${{ inputs.image }} \
--tag ${{ inputs.registry }}/$OWNER/$SHORT_IMAGE_NAME:latest images/$SHORT_IMAGE_NAME/ \
--build-arg REGISTRY=${{ inputs.registry }} \
--build-arg OWNER=${{ github.repository_owner }} $BUILD_ARGS \
--build-arg OWNER=$OWNER $BUILD_ARGS \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--label "org.opencontainers.image.description=$SHORT_IMAGE_NAME"
env:
Expand All @@ -103,11 +107,11 @@ jobs:
# Skip tests when running with ACT
if: env.ACT_SKIP_TESTS == ''
run: |
python3 -m tests.run_tests --short-image-name $SHORT_IMAGE_NAME --registry ${{ inputs.registry }} --owner ${{ github.repository_owner }}
python3 -m tests.run_tests --short-image-name $SHORT_IMAGE_NAME --registry ${{ inputs.registry }} --owner $OWNER
shell: bash

- name: Push latest tag image to registry 📤
run: docker push ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }}
run: docker push ${{ inputs.registry }}/$OWNER/${{ inputs.image }}
shell: bash


Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/docker-tag-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ jobs:
username: ${{ secrets.registry_username }}
password: ${{ secrets.registry_token }}

- name: Lower github repository owner
run: echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_ENV
shell: bash

- name: Pull latest tag image 📥
run: docker pull ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.image }}
run: docker pull ${{ inputs.registry }}/$OWNER/${{ inputs.image }}
shell: bash

- name: Apply tags to the loaded image 🏷
run: python3 -m okdp.extension.tagging.apply_tags --short-image-name ${{ inputs.image }} --registry ${{ inputs.registry }} --owner ${{ github.repository_owner }}
run: python3 -m okdp.extension.tagging.apply_tags --short-image-name ${{ inputs.image }} --registry ${{ inputs.registry }} --owner $OWNER

- name: Prepare image push 📦
run: |
Expand All @@ -61,5 +65,5 @@ jobs:
shell: bash

- name: Push Images to Registry 📤
run: docker push --all-tags ${{ inputs.registry }}/${{ github.repository_owner }}/$SHORT_IMAGE_NAME
run: docker push --all-tags ${{ inputs.registry }}/$OWNER/$SHORT_IMAGE_NAME
shell: bash
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

0 comments on commit 55b1ad9

Please sign in to comment.