diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index 0a1efdb..a57a727 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -16,6 +16,14 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Configure backend image name + shell: bash + run: | + set -euo pipefail + owner=$(echo "${{ gitea.repository }}" | cut -d/ -f1 | tr '[:upper:]' '[:lower:]') + name=$(echo "${{ gitea.repository }}" | cut -d/ -f2 | tr '[:upper:]' '[:lower:]') + echo "IMAGE_NAME=${{ env.REGISTRY }}/${owner}/${name}-backend" >> "${GITHUB_ENV}" + - name: Prepare backend build context shell: bash run: | @@ -50,8 +58,8 @@ jobs: platforms: linux/amd64 push: true tags: | - ${{ env.REGISTRY }}/${{ gitea.repository }}:backend-latest - ${{ env.REGISTRY }}/${{ gitea.repository }}:backend-${{ gitea.sha }} + ${{ env.IMAGE_NAME }}:latest + ${{ env.IMAGE_NAME }}:${{ gitea.sha }} cache-from: type=gha,scope=backend cache-to: type=gha,mode=max,scope=backend labels: | @@ -67,6 +75,14 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Configure frontend image name + shell: bash + run: | + set -euo pipefail + owner=$(echo "${{ gitea.repository }}" | cut -d/ -f1 | tr '[:upper:]' '[:lower:]') + name=$(echo "${{ gitea.repository }}" | cut -d/ -f2 | tr '[:upper:]' '[:lower:]') + echo "IMAGE_NAME=${{ env.REGISTRY }}/${owner}/${name}-frontend" >> "${GITHUB_ENV}" + - name: Prepare frontend build context shell: bash run: | @@ -107,8 +123,8 @@ jobs: platforms: linux/amd64 push: true tags: | - ${{ env.REGISTRY }}/${{ gitea.repository }}:frontend-latest - ${{ env.REGISTRY }}/${{ gitea.repository }}:frontend-${{ gitea.sha }} + ${{ env.IMAGE_NAME }}:latest + ${{ env.IMAGE_NAME }}:${{ gitea.sha }} cache-from: type=gha,scope=frontend cache-to: type=gha,mode=max,scope=frontend labels: |