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