mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	update the CI/CD scripts to not build and push docker images from master, update 'latest' version together with tagged releases.
This commit is contained in:
		
							
								
								
									
										21
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -225,7 +225,7 @@ jobs: | |||||||
|  |  | ||||||
|   # build and push image to docker hub. |   # build and push image to docker hub. | ||||||
|   build-docker-image: |   build-docker-image: | ||||||
|     if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) |     if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     needs: [frontend, tests] |     needs: [frontend, tests] | ||||||
|     steps: |     steps: | ||||||
| @@ -233,15 +233,18 @@ jobs: | |||||||
|         name: Prepare |         name: Prepare | ||||||
|         id: prepare |         id: prepare | ||||||
|         run: | |         run: | | ||||||
|           VERSION=edge |           IMAGE_NAME=jonaswinkler/paperless-ng | ||||||
|           if [[ $GITHUB_REF == refs/tags/ng-* ]]; then |           if [[ $GITHUB_REF == refs/tags/ng-* ]]; then | ||||||
|             VERSION=${GITHUB_REF#refs/tags/ng-} |             TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ng-},${IMAGE_NAME}:latest | ||||||
|           elif [[ $GITHUB_REF == refs/heads/master ]]; then |             INSPECT_TAG=${IMAGE_NAME}:latest | ||||||
|             VERSION=latest |  | ||||||
|           elif [[ $GITHUB_REF == refs/heads/* ]]; then |           elif [[ $GITHUB_REF == refs/heads/* ]]; then | ||||||
|             VERSION=${GITHUB_REF#refs/heads/} |             TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/heads/} | ||||||
|  |             INSPECT_TAG=${TAGS} | ||||||
|  |           else | ||||||
|  |             exit 1 | ||||||
|           fi |           fi | ||||||
|           echo ::set-output name=version::${VERSION} |           echo ::set-output name=tags::${TAGS} | ||||||
|  |           echo ::set-output name=inspect_tag::${INSPECT_TAG} | ||||||
|       - |       - | ||||||
|         name: Checkout |         name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v2 | ||||||
| @@ -279,10 +282,10 @@ jobs: | |||||||
|           file: ./Dockerfile |           file: ./Dockerfile | ||||||
|           platforms: linux/amd64,linux/arm/v7,linux/arm64 |           platforms: linux/amd64,linux/arm/v7,linux/arm64 | ||||||
|           push: true |           push: true | ||||||
|           tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} |           tags: ${{ steps.prepare.outputs.tags }} | ||||||
|           cache-from: type=local,src=/tmp/.buildx-cache |           cache-from: type=local,src=/tmp/.buildx-cache | ||||||
|           cache-to: type=local,dest=/tmp/.buildx-cache |           cache-to: type=local,dest=/tmp/.buildx-cache | ||||||
|       - |       - | ||||||
|         name: Inspect image |         name: Inspect image | ||||||
|         run: | |         run: | | ||||||
|           docker buildx imagetools inspect jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} |           docker buildx imagetools inspect ${{ steps.prepare.outputs.inspect_tag }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler