Skip to content

Commit 64c45b5

Browse files
committed
Fix CD pipeline
1 parent 4dd3228 commit 64c45b5

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

.github/workflows/publish-docker-image.yml

+28-20
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,48 @@ jobs:
2121
packages: write
2222
attestations: write
2323
id-token: write
24-
#
24+
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828

2929
- name: Log in to the Container registry
30-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
30+
uses: docker/login-action@v2
3131
with:
3232
registry: ${{ env.REGISTRY }}
3333
username: ${{ github.actor }}
3434
password: ${{ secrets.GITHUB_TOKEN }}
35-
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels.
36-
- name: Extract metadata (tags, labels) for Docker
37-
id: meta
38-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
35+
36+
- name: Build and push backend Docker image
37+
uses: docker/build-push-action@v3
3938
with:
40-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41-
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
42-
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
43-
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
44-
- name: Build and push Docker image
45-
id: push
46-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
39+
context: ./backend
40+
push: true
41+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/karevo-dashboard-backend:latest
42+
labels: |
43+
org.opencontainers.image.source=${{ github.repository }}
44+
org.opencontainers.image.version=${{ github.sha }}
45+
46+
- name: Build and push frontend Docker image
47+
uses: docker/build-push-action@v3
4748
with:
48-
context: .
49+
context: ./frontend
4950
push: true
50-
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
51+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/karevo-dashboard-frontend:latest
52+
labels: |
53+
org.opencontainers.image.source=${{ github.repository }}
54+
org.opencontainers.image.version=${{ github.sha }}
5255
53-
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
54-
- name: Generate artifact attestation
56+
- name: Generate artifact attestation for backend
5557
uses: actions/attest-build-provenance@v1
5658
with:
57-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
58-
subject-digest: ${{ steps.push.outputs.digest }}
59+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/karevo-dashboard-backend:latest
60+
subject-digest: ${{ steps.backend_push.outputs.digest }}
5961
push-to-registry: true
6062

63+
- name: Generate artifact attestation for frontend
64+
uses: actions/attest-build-provenance@v1
65+
with:
66+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/karevo-dashboard-frontend:latest
67+
subject-digest: ${{ steps.frontend_push.outputs.digest }}
68+
push-to-registry: true

0 commit comments

Comments
 (0)