52 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: docker-monica-build development
 | 
						|
 | 
						|
on:
 | 
						|
  push:
 | 
						|
    branches-ignore:
 | 
						|
      - main # Läuft auf allen Branches außer `main`
 | 
						|
 | 
						|
jobs:
 | 
						|
  dockerfile_lint:
 | 
						|
    runs-on: ubuntu-22.04
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v4
 | 
						|
      - uses: hadolint/hadolint-action@v3.1.0
 | 
						|
        with:
 | 
						|
          dockerfile: Dockerfile
 | 
						|
 | 
						|
  build:
 | 
						|
    needs: dockerfile_lint
 | 
						|
    runs-on: ubuntu-22.04
 | 
						|
    env:
 | 
						|
      DOCKER_HOST: tcp://localhost:2375  # unverschlüsselte Verbindung
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@v4
 | 
						|
 | 
						|
      - name: Clean Branch Name
 | 
						|
        id: clean_branch_name
 | 
						|
        run: |
 | 
						|
          CLEANED_BRANCH_NAME=$(echo "${GITHUB_REF_NAME}" | tr '[:upper:]' '[:lower:]' | tr '/_' '-')
 | 
						|
          echo "CLEAN_BRANCH_NAME=${CLEANED_BRANCH_NAME}" >> $GITHUB_ENV
 | 
						|
 | 
						|
      - name: Set up Docker Buildx
 | 
						|
        uses: docker/setup-buildx-action@v3
 | 
						|
        with:
 | 
						|
          driver-opts: host=tcp://localhost:2375  # Verbindung ohne TLS
 | 
						|
 | 
						|
      - name: Log in to registry
 | 
						|
        uses: docker/login-action@v2
 | 
						|
        with:
 | 
						|
          registry: gitea.sikorski.cloud
 | 
						|
          username: rogersik
 | 
						|
          password: ${{ secrets.REGISTRY_PASSWORD }}
 | 
						|
 | 
						|
      - name: Build and push Docker image
 | 
						|
        run: |
 | 
						|
          docker buildx build \
 | 
						|
            --platform linux/amd64,linux/arm64 \
 | 
						|
            --tag gitea.sikorski.cloud/rogersik/monica:${CLEAN_BRANCH_NAME} \
 | 
						|
            --cache-from=type=registry,ref=gitea.sikorski.cloud/rogersik/monica:cache \
 | 
						|
            --cache-to=type=registry,ref=gitea.sikorski.cloud/rogersik/monica:cache,mode=max \
 | 
						|
            --push \
 | 
						|
            .
 |