build openpilot prebuilt on schedule (#19847)
	
		
	
				
					
				
			* build openpilot prebuilt on schedule
* test
* back to schedule
* rename
old-commit-hash: a08360c4d0
			
			
				commatwo_master
			
			
		
							parent
							
								
									51f8dc7f0e
								
							
						
					
					
						commit
						b52e931907
					
				
				 1 changed files with 41 additions and 0 deletions
			
			
		@ -0,0 +1,41 @@ | 
				
			||||
name: prebuilt | 
				
			||||
on: | 
				
			||||
  schedule: | 
				
			||||
    - cron: '0 * * * *' | 
				
			||||
 | 
				
			||||
env: | 
				
			||||
  BASE_IMAGE: openpilot-base | 
				
			||||
  DOCKER_REGISTRY: ghcr.io/commaai | 
				
			||||
 | 
				
			||||
  DOCKER_LOGIN: docker login ghcr.io -u adeebshihadeh -p ${{ secrets.CONTAINER_TOKEN }} | 
				
			||||
  BUILD: | | 
				
			||||
      docker pull $(grep -iohP '(?<=^from)\s+\S+' Dockerfile.openpilot_base) || true | 
				
			||||
      docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true | 
				
			||||
      docker build --cache-from $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $BASE_IMAGE:latest -f Dockerfile.openpilot_base . | 
				
			||||
 | 
				
			||||
jobs: | 
				
			||||
  build_prebuilt: | 
				
			||||
    name: build prebuilt | 
				
			||||
    runs-on: ubuntu-20.04 | 
				
			||||
    timeout-minutes: 60 | 
				
			||||
    if: github.repository == 'commaai/openpilot' | 
				
			||||
    env: | 
				
			||||
      IMAGE_NAME: openpilot-prebuilt | 
				
			||||
    steps: | 
				
			||||
    - name: Wait for green check mark | 
				
			||||
      uses: lewagon/wait-on-check-action@v0.2 | 
				
			||||
      with: | 
				
			||||
        ref: master | 
				
			||||
        wait-interval: 20 | 
				
			||||
    - uses: actions/checkout@v2 | 
				
			||||
      with: | 
				
			||||
        submodules: true | 
				
			||||
    - name: Build Docker image | 
				
			||||
      run: | | 
				
			||||
        eval "$BUILD" | 
				
			||||
        docker pull $DOCKER_REGISTRY/$IMAGE_NAME:latest || true | 
				
			||||
        docker build --cache-from $DOCKER_REGISTRY/$IMAGE_NAME:latest -t $DOCKER_REGISTRY/$IMAGE_NAME:latest -f Dockerfile.openpilot . | 
				
			||||
    - name: Push to container registry | 
				
			||||
      run: | | 
				
			||||
        $DOCKER_LOGIN | 
				
			||||
        docker push $DOCKER_REGISTRY/$IMAGE_NAME:latest | 
				
			||||
					Loading…
					
					
				
		Reference in new issue