Skip to content

Commit 3caf0c0

Browse files
author
Prakash
committed
Changing the build file to support multi platforms
1 parent 5cc62ea commit 3caf0c0

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,29 @@ jobs:
5151
username: ${{ github.actor }}
5252
password: ${{ secrets.GITHUB_TOKEN }}
5353

54-
- name: Build Docker image
54+
- name: Build & push multi-arch image (temp)
5555
uses: docker/build-push-action@v5
5656
with:
5757
context: .
5858
file: package/docker/Dockerfile
59-
push: false
60-
load: true
61-
tags: clinical-frontend:local
62-
cache-from: type=gha
63-
cache-to: type=gha,mode=max
59+
platforms: linux/amd64,linux/arm64
60+
push: true
61+
tags: ghcr.io/bahnew/clinical-frontend:temp
6462

6563
- name: Scan Docker image for vulnerabilities
6664
uses: aquasecurity/trivy-action@0.30.0
6765
with:
68-
image-ref: 'clinical-frontend:local'
66+
image-ref: 'ghcr.io/bahnew/clinical-frontend:temp'
6967
format: 'table'
7068
exit-code: '1'
7169
severity: 'CRITICAL'
72-
73-
- name: Tag and push Docker image
74-
run: |
75-
docker tag clinical-frontend:local ghcr.io/bahnew/clinical-frontend:latest
76-
docker push ghcr.io/bahnew/clinical-frontend:latest
7770

71+
- name: Retag & push final image
72+
if: success()
73+
run: |
74+
docker manifest create ghcr.io/bahnew/clinical-frontend:latest \
75+
--amend ghcr.io/bahnew/clinical-frontend:temp
76+
docker manifest push ghcr.io/bahnew/clinical-frontend:latest
7877
7978
- name: Repository Dispatch
8079
run: |

0 commit comments

Comments
 (0)