CI: fix registry usage - separate registry hostname and repo name
Some checks failed
Build and Push Sandbox Base Image / build (push) Failing after 2m7s
Some checks failed
Build and Push Sandbox Base Image / build (push) Failing after 2m7s
This commit is contained in:
@@ -26,12 +26,12 @@ jobs:
|
|||||||
- name: Set image name (lowercase)
|
- name: Set image name (lowercase)
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
echo "image=${{ secrets.DOCKER_REGISTRY }}/${{ toLower(gitea.repository) }}" >> $GITHUB_OUTPUT
|
echo "repo=${{ toLower(gitea.repository) }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ steps.meta.outputs.image }}
|
registry: ${{ secrets.DOCKER_REGISTRY }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
@@ -42,14 +42,14 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.meta.outputs.image }}:${{ github.sha }}
|
${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:${{ github.sha }}
|
||||||
${{ steps.meta.outputs.image }}:latest
|
${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:latest
|
||||||
cache-from: type=registry,ref=${{ steps.meta.outputs.image }}:latest
|
cache-from: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:latest
|
||||||
cache-to: type=registry,ref=${{ steps.meta.outputs.image }}:latest,mode=max
|
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:latest,mode=max
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
- name: Tag and push stable (main only)
|
- name: Tag and push stable (main only)
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
docker tag ${{ steps.meta.outputs.image }}:${{ github.sha }} ${{ steps.meta.outputs.image }}:stable
|
docker tag ${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:${{ github.sha }} ${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:stable
|
||||||
docker push ${{ steps.meta.outputs.image }}:stable
|
docker push ${{ secrets.DOCKER_REGISTRY }}/${{ steps.meta.outputs.repo }}:stable
|
||||||
|
|||||||
Reference in New Issue
Block a user