Upgrade docker GH actions + use layers caching for faster builds (#2697)
This commit is contained in:
10
.github/workflows/build-docker-image.yml
vendored
10
.github/workflows/build-docker-image.yml
vendored
@@ -34,10 +34,10 @@ jobs:
|
|||||||
username: ${{ env.DOCKERHUB_USERNAME }}
|
username: ${{ env.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build, tag, and push backend image to Amazon Public ECR and Docker Hub
|
- name: Build, tag, and push backend image to Amazon Public ECR and Docker Hub
|
||||||
id: build-image
|
id: build-image
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
env:
|
env:
|
||||||
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
|
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
|
||||||
with:
|
with:
|
||||||
@@ -46,6 +46,8 @@ jobs:
|
|||||||
linux/amd64
|
linux/amd64
|
||||||
linux/arm64
|
linux/arm64
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }}
|
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }}
|
||||||
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }}
|
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }}
|
||||||
@@ -55,12 +57,14 @@ jobs:
|
|||||||
${{ env.DOCKERHUB_USERNAME }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest
|
${{ env.DOCKERHUB_USERNAME }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest
|
||||||
- name: Build, tag, and push ui image to Amazon Public ECR and Docker Hub
|
- name: Build, tag, and push ui image to Amazon Public ECR and Docker Hub
|
||||||
id: build-ui-image
|
id: build-ui-image
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
env:
|
env:
|
||||||
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
|
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile.ui
|
file: Dockerfile.ui
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
platforms: |
|
platforms: |
|
||||||
linux/amd64
|
linux/amd64
|
||||||
linux/arm64
|
linux/arm64
|
||||||
|
|||||||
Reference in New Issue
Block a user