Skip to content

Commit

Permalink
ci: set image name by env or label
Browse files Browse the repository at this point in the history
  • Loading branch information
pythoninthegrass committed Oct 16, 2024
1 parent 90fc909 commit b866805
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ jobs:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASS }}

- name: Extract image name from Dockerfile
- name: Set image name
id: image_name
run: |
IMAGE=$(grep "LABEL org.opencontainers.image.title" Dockerfile | cut -d'"' -f2)
if [ -n "${{ env.IMAGE }}" ]; then
IMAGE="${{ env.IMAGE }}"
else
IMAGE=$(grep "LABEL org.opencontainers.image.title" Dockerfile | cut -d'"' -f2)
fi
echo "IMAGE=$IMAGE" >> $GITHUB_OUTPUT
echo "IMAGE=$IMAGE" >> $GITHUB_ENV
- name: Docker meta
id: meta
Expand Down

0 comments on commit b866805

Please sign in to comment.