ci: lowercase image names for GHCR compatibility on forks
This commit is contained in:
@@ -39,8 +39,11 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
BACKEND_IMAGE_NAME: ${{ github.repository }}/backend
|
# BACKEND_IMAGE_NAME and FRONTEND_IMAGE_NAME are computed per job in the
|
||||||
FRONTEND_IMAGE_NAME: ${{ github.repository }}/frontend
|
# "Compute image names" step. GHCR requires all-lowercase repository names,
|
||||||
|
# but ${{ github.repository }} preserves the original case (e.g. "Luca-Timo/...").
|
||||||
|
# Computing them with bash parameter expansion (${VAR,,}) keeps the workflow
|
||||||
|
# working on forks regardless of the owner's name casing.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@@ -64,6 +67,12 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Compute image names (lowercase for GHCR)
|
||||||
|
run: |
|
||||||
|
repo_lc="${GITHUB_REPOSITORY,,}"
|
||||||
|
echo "BACKEND_IMAGE_NAME=${repo_lc}/backend" >> "$GITHUB_ENV"
|
||||||
|
echo "FRONTEND_IMAGE_NAME=${repo_lc}/frontend" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Prepare platform pair
|
- name: Prepare platform pair
|
||||||
run: |
|
run: |
|
||||||
platform="${{ matrix.platform }}"
|
platform="${{ matrix.platform }}"
|
||||||
@@ -148,6 +157,12 @@ jobs:
|
|||||||
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Compute image names (lowercase for GHCR)
|
||||||
|
run: |
|
||||||
|
repo_lc="${GITHUB_REPOSITORY,,}"
|
||||||
|
echo "BACKEND_IMAGE_NAME=${repo_lc}/backend" >> "$GITHUB_ENV"
|
||||||
|
echo "FRONTEND_IMAGE_NAME=${repo_lc}/frontend" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Download digest artifacts
|
- name: Download digest artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -247,6 +262,12 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Compute image names (lowercase for GHCR)
|
||||||
|
run: |
|
||||||
|
repo_lc="${GITHUB_REPOSITORY,,}"
|
||||||
|
echo "BACKEND_IMAGE_NAME=${repo_lc}/backend" >> "$GITHUB_ENV"
|
||||||
|
echo "FRONTEND_IMAGE_NAME=${repo_lc}/frontend" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Prepare platform pair
|
- name: Prepare platform pair
|
||||||
run: |
|
run: |
|
||||||
platform="${{ matrix.platform }}"
|
platform="${{ matrix.platform }}"
|
||||||
@@ -330,6 +351,12 @@ jobs:
|
|||||||
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Compute image names (lowercase for GHCR)
|
||||||
|
run: |
|
||||||
|
repo_lc="${GITHUB_REPOSITORY,,}"
|
||||||
|
echo "BACKEND_IMAGE_NAME=${repo_lc}/backend" >> "$GITHUB_ENV"
|
||||||
|
echo "FRONTEND_IMAGE_NAME=${repo_lc}/frontend" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Download digest artifacts
|
- name: Download digest artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -416,6 +443,12 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Compute image names (lowercase for GHCR)
|
||||||
|
run: |
|
||||||
|
repo_lc="${GITHUB_REPOSITORY,,}"
|
||||||
|
echo "BACKEND_IMAGE_NAME=${repo_lc}/backend" >> "$GITHUB_ENV"
|
||||||
|
echo "FRONTEND_IMAGE_NAME=${repo_lc}/frontend" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Build Summary
|
- name: Build Summary
|
||||||
run: |
|
run: |
|
||||||
echo "## 🐳 Docker Build Summary" >> $GITHUB_STEP_SUMMARY
|
echo "## 🐳 Docker Build Summary" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
Reference in New Issue
Block a user