Skip to content

Commit

Permalink
Fix tag paths
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Aug 16, 2024
1 parent a86c554 commit 6303232
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
if [[ ${{ matrix.build.latest }} == "true" ]]; then
echo "Marking latest"
# GHCR.io
TAGS="${img_path}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path}:${base_tag}, ${img_path}:latest, ${img_path}:latest-cuda"
TAGS="${img_path_ghcr}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_ghcr}:${base_tag}, ${img_path_ghcr}:latest, ${img_path_ghcr}:latest-cuda"
# Docker.io Tags
TAGS="${TAGS}, ${img_path_dhub}:${KOHYA_BUILD_REF}, ${img_path_dhub}:latest"
else
TAGS="${img_path}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_dhub}:${KOHYA_BUILD_REF}"
TAGS="${img_path_ghcr}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_dhub}:${KOHYA_BUILD_REF}"
fi
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
-
Expand Down Expand Up @@ -120,27 +120,35 @@ jobs:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
REPO=${GITHUB_REPOSITORY,,}
echo "REPO_NAMESPACE=${REPO%%/*}" >> ${GITHUB_ENV}
echo "REPO_NAME=${REPO#*/}" >> ${GITHUB_ENV}
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
target="${HOME}/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
img_path_ghcr="ghcr.io/${{ env.REPO_NAMESPACE }}/${{ env.REPO_NAME }}"
img_path_dhub="${{ vars.DOCKERHUB_USER }}/${{ env.REPO_NAME }}-rocm"
if [[ -z '${{ matrix.build.kohya }}' ]]; then
KOHYA_BUILD_REF="$(curl -s https://api.github.com/repos/bmaltais/kohya_ss/tags | jq -r '.[0].name')"
Expand All @@ -155,11 +163,11 @@ jobs:
if [[ ${{ matrix.build.latest }} == "true" ]]; then
echo "Marking latest"
# GHCR.io Tags
TAGS="${img_path}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path}:${base_tag}, ${img_path}:latest-rocm"
TAGS="${img_path_ghcr}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_ghcr}:${base_tag}, ${img_path_ghcr}:latest-rocm"
# Docker.io Tags
TAGS="${TAGS}, ${img_path_dhub}:${KOHYA_BUILD_REF}, ${img_path_dhub}:latest"
else
TAGS="${img_path}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_dhub}:${KOHYA_BUILD_REF}"
TAGS="${img_path_ghcr}:${base_tag}-${KOHYA_BUILD_REF}, ${img_path_dhub}:${KOHYA_BUILD_REF}"
fi
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
-
Expand Down

0 comments on commit 6303232

Please sign in to comment.