Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 359044eb21 | |||
| 165dbd5f34 | |||
| 8f7ffa41d1 |
@@ -9,8 +9,8 @@ on:
|
|||||||
env:
|
env:
|
||||||
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
|
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
|
||||||
GOPRIVATE: git.daviestechlabs.io
|
GOPRIVATE: git.daviestechlabs.io
|
||||||
REGISTRY: registry.lab.daviestechlabs.io/daviestechlabs
|
REGISTRY: gitea-http.gitea.svc.cluster.local:3000/daviestechlabs
|
||||||
REGISTRY_HOST: registry.lab.daviestechlabs.io
|
REGISTRY_HOST: gitea-http.gitea.svc.cluster.local:3000
|
||||||
IMAGE_NAME: stt-module
|
IMAGE_NAME: stt-module
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -121,22 +121,19 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Configure insecure registry
|
||||||
uses: docker/setup-buildx-action@v3
|
run: |
|
||||||
|
sudo mkdir -p /etc/docker
|
||||||
|
echo '{"insecure-registries": ["${{ env.REGISTRY_HOST }}"]}' | sudo tee /etc/docker/daemon.json
|
||||||
|
sudo kill -SIGHUP "$(pidof dockerd)" || true
|
||||||
|
sleep 3
|
||||||
|
|
||||||
- name: Login to Gitea Registry
|
- name: Login to Gitea Registry
|
||||||
uses: docker/login-action@v3
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY_HOST }}" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY_HOST }}
|
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: vars.DOCKERHUB_USERNAME != ''
|
if: vars.DOCKERHUB_USERNAME != ''
|
||||||
uses: docker/login-action@v3
|
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ vars.DOCKERHUB_USERNAME }}" --password-stdin
|
||||||
with:
|
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Extract metadata
|
||||||
id: meta
|
id: meta
|
||||||
@@ -144,17 +141,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}},value=${{ needs.release.outputs.version }}
|
type=raw,value=${{ needs.release.outputs.version }}
|
||||||
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.version }}
|
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
run: |
|
||||||
with:
|
# Build with all tags
|
||||||
context: .
|
TAGS=""
|
||||||
push: true
|
while IFS= read -r tag; do
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
[ -n "$tag" ] && TAGS="$TAGS -t $tag"
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
done <<< "${{ steps.meta.outputs.tags }}"
|
||||||
|
docker build $TAGS \
|
||||||
|
--label "org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}" \
|
||||||
|
--label "org.opencontainers.image.revision=${{ gitea.sha }}" \
|
||||||
|
.
|
||||||
|
# Push each tag
|
||||||
|
while IFS= read -r tag; do
|
||||||
|
[ -n "$tag" ] && docker push "$tag"
|
||||||
|
done <<< "${{ steps.meta.outputs.tags }}"
|
||||||
|
|
||||||
|
|
||||||
notify:
|
notify:
|
||||||
|
|||||||
Reference in New Issue
Block a user