mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Refactor docker CI for speed increases (#6562)
* push to ghcr (#168) * Update docker.yaml * Update docker.yaml * Update docker.yaml * use matrix to build for the plattforms (faster amd pub) * try Buildjet * switch to pyhton 3.9 * Update docker.yaml * path python manually? * bump python to 3.11 * Update Dockerfile * step down vm * cleanup workflow * install docker on mac * and docker compose too * switch back to linux * Docker tests (#175) * push to ghcr (#168) * Update docker.yaml * Update docker.yaml * Update docker.yaml * use matrix to build for the plattforms (faster amd pub) * try Buildjet * switch to pyhton 3.9 * Update docker.yaml * path python manually? * bump python to 3.11 * Update Dockerfile * step down vm * cleanup workflow * install docker on mac * and docker compose too * switch back to linux * switch to uv * fix uv install * reintroduce checks * cleanup diff
This commit is contained in:
		
							
								
								
									
										22
									
								
								.github/workflows/docker.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								.github/workflows/docker.yaml
									
									
									
									
										vendored
									
									
								
							@@ -25,7 +25,6 @@ on:
 | 
			
		||||
      - 'master'
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
 | 
			
		||||
  paths-filter:
 | 
			
		||||
    name: Filter
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
@@ -48,10 +47,8 @@ jobs:
 | 
			
		||||
              - requirements.txt
 | 
			
		||||
              - tasks.py
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  # Build the docker image
 | 
			
		||||
  build:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    needs: paths-filter
 | 
			
		||||
    if: needs.paths-filter.outputs.docker == 'true' || github.event_name == 'release' || github.event_name == 'push'
 | 
			
		||||
    permissions:
 | 
			
		||||
@@ -60,7 +57,17 @@ jobs:
 | 
			
		||||
      id-token: write
 | 
			
		||||
    env:
 | 
			
		||||
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
      python_version: 3.9
 | 
			
		||||
      python_version: "3.11"
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        platform: ["linux/amd64", "linux/arm64"]
 | 
			
		||||
        include:
 | 
			
		||||
          - platform: linux/amd64
 | 
			
		||||
            os: ubuntu-latest
 | 
			
		||||
          - platform: linux/arm64
 | 
			
		||||
            os: ubuntu-latest # in the future we can try to use alternative runners here
 | 
			
		||||
    runs-on: ${{ matrix.os }}
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Check out repo
 | 
			
		||||
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
 | 
			
		||||
@@ -77,8 +84,7 @@ jobs:
 | 
			
		||||
          echo "git_commit_date=$(git show -s --format=%ci)" >> $GITHUB_ENV
 | 
			
		||||
      - name: Build Docker Image
 | 
			
		||||
        # Build the development docker image (using docker-compose.yml)
 | 
			
		||||
        run: |
 | 
			
		||||
          docker-compose build --no-cache
 | 
			
		||||
        run: docker-compose build --no-cache
 | 
			
		||||
      - name: Update Docker Image
 | 
			
		||||
        run: |
 | 
			
		||||
          docker-compose run inventree-dev-server invoke update
 | 
			
		||||
@@ -145,12 +151,12 @@ jobs:
 | 
			
		||||
        uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # pin@v5.0.0
 | 
			
		||||
        with:
 | 
			
		||||
          context: .
 | 
			
		||||
          platforms: linux/amd64,linux/arm64
 | 
			
		||||
          platforms: ${{ matrix.platform }}
 | 
			
		||||
          push: true
 | 
			
		||||
          sbom: true
 | 
			
		||||
          provenance: false
 | 
			
		||||
          target: production
 | 
			
		||||
          tags: ${{ env.docker_tags }}
 | 
			
		||||
          tags: ${{ steps.meta.outputs.tags }}
 | 
			
		||||
          build-args: |
 | 
			
		||||
            commit_hash=${{ env.git_commit_hash }}
 | 
			
		||||
            commit_date=${{ env.git_commit_date }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user