diff --git a/.gitea/scripts/push-image.sh b/.gitea/scripts/push-image.sh index cb0b7f8..1e5e40c 100644 --- a/.gitea/scripts/push-image.sh +++ b/.gitea/scripts/push-image.sh @@ -14,7 +14,7 @@ skopeo copy \ "docker-archive:result" \ "docker://${IMAGE}" -if [ "${GITEA_REF_TYPE:-}" = "branch" ] && [ "${GITEA_REF_NAME:-}" = "main" ]; then +if [ "${REF_NAME:-}" = "main" ]; then skopeo copy \ --dest-creds "${USERNAME}:${PASSWORD}" \ "docker-archive:result" \ diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index 8d878ca..210deeb 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -21,6 +21,7 @@ jobs: REPOSITORY: "${{ gitea.repository }}" USERNAME: "${{ secrets.REGISTRY_USER }}" PASSWORD: "${{ secrets.REGISTRY_TOKEN }}" + REF_NAME: "${{ gitea.ref_name }}" TAG: "${{ gitea.sha }}" run: bash .gitea/scripts/push-image.sh @@ -41,5 +42,6 @@ jobs: REPOSITORY: "${{ gitea.repository }}-web" USERNAME: "${{ secrets.REGISTRY_USER }}" PASSWORD: "${{ secrets.REGISTRY_TOKEN }}" + REF_NAME: "${{ gitea.ref_name }}" TAG: "${{ gitea.sha }}" run: bash .gitea/scripts/push-image.sh