This commit is contained in:
@@ -6,7 +6,7 @@ on:
|
|||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: git.mancheff.com
|
REGISTRY: 192.168.0.86:3000
|
||||||
IMAGE_NAME: hiyv-demo/hiyv-nginx
|
IMAGE_NAME: hiyv-demo/hiyv-nginx
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -38,15 +38,23 @@ jobs:
|
|||||||
echo "tags=${image}:${version},${image}:${major_minor},${image}:${major},${image}:${GITHUB_SHA},${image}:latest"
|
echo "tags=${image}:${version},${image}:${major_minor},${image}:${major},${image}:${GITHUB_SHA},${image}:latest"
|
||||||
} >> "${GITHUB_OUTPUT}"
|
} >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Log in to the Gitea registry
|
- name: Configure Gitea registry credentials
|
||||||
uses: docker/login-action@v3
|
shell: bash
|
||||||
with:
|
env:
|
||||||
registry: ${{ env.REGISTRY }}
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
run: |
|
||||||
|
mkdir -p "${HOME}/.docker"
|
||||||
|
auth="$(printf '%s:%s' "${REGISTRY_USERNAME}" "${REGISTRY_TOKEN}" | base64 | tr -d '\n')"
|
||||||
|
printf '{"auths":{"%s":{"auth":"%s"}}}\n' "${REGISTRY}" "${auth}" > "${HOME}/.docker/config.json"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-config-inline: |
|
||||||
|
[registry."192.168.0.86:3000"]
|
||||||
|
http = true
|
||||||
|
insecure = true
|
||||||
|
|
||||||
- name: Build and publish
|
- name: Build and publish
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -55,9 +63,10 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
COMMIT_ID=${{ github.sha }}
|
COMMIT_ID=${{ github.sha }}
|
||||||
|
NGINX_BASE=${{ env.REGISTRY }}/hiyv-demo/nginx-base:1.28-alpine-amd64
|
||||||
tags: ${{ steps.tags.outputs.tags }}
|
tags: ${{ steps.tags.outputs.tags }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.version=${{ steps.tags.outputs.version }}
|
org.opencontainers.image.version=${{ steps.tags.outputs.version }}
|
||||||
org.opencontainers.image.revision=${{ github.sha }}
|
org.opencontainers.image.revision=${{ github.sha }}
|
||||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
org.opencontainers.image.source=https://git.mancheff.com/${{ github.repository }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
FROM git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64
|
ARG NGINX_BASE=git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64
|
||||||
|
FROM ${NGINX_BASE}
|
||||||
|
|
||||||
ARG COMMIT_ID=unknown
|
ARG COMMIT_ID=unknown
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Git commit used to build the published container.
|
|||||||
## Run it
|
## Run it
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.2
|
docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.3
|
||||||
```
|
```
|
||||||
|
|
||||||
Open <http://localhost:8080>. The health endpoint is available at
|
Open <http://localhost:8080>. The health endpoint is available at
|
||||||
|
|||||||
Reference in New Issue
Block a user