Skip to content

Commit

Permalink
Use separate frontend and backend Docker push actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z authored Mar 7, 2024
1 parent 7b8bf9b commit 858a955
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,38 @@ jobs:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract metadata (tags, labels) for Docker (frontend)
id: meta-frontend
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
with:
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
prefix=frontend
- name: Extract metadata (tags, labels) for Docker (backend)
id: meta-backend
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
with:
images: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
prefix=backend
- name: Build and push Docker image (frontend)
uses: docker/build-push-action@91df6b874e498451163feb47610c87c4a218c1ee
with:
context: frontend
push: true
build-args: |
DOCKER_METADATA_OUTPUT_JSON
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}

- name: Build and push Docker image
- name: Build and push Docker image (backend)
uses: docker/build-push-action@91df6b874e498451163feb47610c87c4a218c1ee
with:
context: .
context: backend
push: true
build-args: |
DOCKER_METADATA_OUTPUT_JSON
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}

0 comments on commit 858a955

Please sign in to comment.