ci: switch to dind runner for Docker build and push
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 27s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 27s
This commit is contained in:
@@ -7,45 +7,37 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: gitea.jeanlucmakiola.de
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: dind
|
||||||
|
container:
|
||||||
|
image: docker:cli
|
||||||
|
services:
|
||||||
|
dind:
|
||||||
|
image: docker:dind
|
||||||
|
options: --privileged
|
||||||
|
env:
|
||||||
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: tcp://dind:2375
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Log in to Gitea registry
|
||||||
uses: docker/setup-buildx-action@v3
|
run: |
|
||||||
|
REGISTRY="${{ gitea.server_url }}"
|
||||||
- name: Login to Gitea Container Registry
|
REGISTRY="${REGISTRY#https://}"
|
||||||
uses: docker/login-action@v3
|
REGISTRY="${REGISTRY#http://}"
|
||||||
with:
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ gitea.actor }}
|
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
|
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
run: |
|
||||||
with:
|
REGISTRY="${{ gitea.server_url }}"
|
||||||
context: .
|
REGISTRY="${REGISTRY#https://}"
|
||||||
push: true
|
REGISTRY="${REGISTRY#http://}"
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
IMAGE="$REGISTRY/${{ gitea.repository }}"
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
docker build -t "$IMAGE:${{ gitea.sha }}" -t "$IMAGE:latest" .
|
||||||
cache-from: type=gha
|
docker push "$IMAGE:${{ gitea.sha }}"
|
||||||
cache-to: type=gha,mode=max
|
docker push "$IMAGE:latest"
|
||||||
|
|||||||
Reference in New Issue
Block a user