Use external registry host in CI
This commit is contained in:
@@ -39,17 +39,16 @@ jobs:
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
env:
|
||||
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
registry_host="${GITHUB_SERVER_URL#http://}"
|
||||
registry_host="${registry_host#https://}"
|
||||
printf '%s' "${REGISTRY_PASSWORD}" | docker login "${registry_host}" -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin
|
||||
printf '%s' "${REGISTRY_PASSWORD}" | docker login "${REGISTRY_HOST}" -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin
|
||||
|
||||
- name: Build and Push Image
|
||||
env:
|
||||
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
|
||||
run: |
|
||||
registry_host="${GITHUB_SERVER_URL#http://}"
|
||||
registry_host="${registry_host#https://}"
|
||||
image="${registry_host}/${GITHUB_REPOSITORY}"
|
||||
image="${REGISTRY_HOST}/${GITHUB_REPOSITORY}"
|
||||
docker build -t "${image}:main" -t "${image}:sha-${GITHUB_SHA}" .
|
||||
docker push "${image}:main"
|
||||
docker push "${image}:sha-${GITHUB_SHA}"
|
||||
|
||||
Reference in New Issue
Block a user