Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
coutug committed Oct 2, 2024
1 parent 64fa892 commit 25f12ca
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAGS: |
type=sha,prefix=,suffix=-{{date 'X'}}
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
type=semver,pattern={{raw}}
jobs:
ghcr:
Expand All @@ -31,8 +36,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract frontend metadata
id: meta-front
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend
Expand All @@ -41,18 +46,28 @@ jobs:
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
type=semver,pattern={{raw}}
- name: Extract backend metadata
id: meta-back
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend
tags: |
type=sha,prefix=,suffix=-{{date 'X'}}
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=develop
type=semver,pattern={{raw}}
- name: Build and push frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# - name: Build and push backend Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./backend
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/backend:${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta-front.outputs.labels }}
- name: Build and push backend Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta-back.outputs.labels }}

0 comments on commit 25f12ca

Please sign in to comment.