mirror of
				https://github.com/ajnart/homarr.git
				synced 2025-10-31 18:46:23 +01:00 
			
		
		
		
	Add multi stage docker build and release
This commit is contained in:
		
							
								
								
									
										19
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							| @@ -11,8 +11,22 @@ env: | |||||||
| jobs: | jobs: | ||||||
|   # Push image to GitHub Packages. |   # Push image to GitHub Packages. | ||||||
|   # See also https://docs.docker.com/docker-hub/builds/ |   # See also https://docs.docker.com/docker-hub/builds/ | ||||||
|  |   build: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/setup-node@v3 | ||||||
|  |       - uses: actions/checkout@v3 | ||||||
|  |       - run: yarn install --frozen-lockfile | ||||||
|  |       - run: yarn export | ||||||
|  |       - uses: actions/cache@v2 | ||||||
|  |         id: restore-build | ||||||
|  |         with: | ||||||
|  |           path: ./out/ | ||||||
|  |           key: ${{ github.sha }} | ||||||
|  |  | ||||||
|   push: |   push: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     needs: [build] | ||||||
|     permissions: |     permissions: | ||||||
|       packages: write |       packages: write | ||||||
|       contents: read |       contents: read | ||||||
| @@ -25,12 +39,11 @@ jobs: | |||||||
|           path: ./out/ |           path: ./out/ | ||||||
|           key: ${{ github.sha }} |           key: ${{ github.sha }} | ||||||
|       - name: Build image |       - name: Build image | ||||||
|         run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" |         run: docker build . --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" | ||||||
|  |  | ||||||
|       - name: Log in to registry |       - name: Log in to registry | ||||||
|         # This is where you will update the PAT to GITHUB_TOKEN |  | ||||||
|         run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin |  | ||||||
|  |  | ||||||
|  |         run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||||||
|       - name: Push image |       - name: Push image | ||||||
|         run: | |         run: | | ||||||
|           IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME |           IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user