Skip to content

Commit

Permalink
Merge pull request #23 from smartSenseSolutions/fix/build-workflow
Browse files Browse the repository at this point in the history
fix: build backend workflow
  • Loading branch information
nitin-vavdiya authored Dec 5, 2024
2 parents 0322245 + b83341e commit 79aeae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 45 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/build_backend.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---

name: Build docker image- backend application
name: Build docker image - backend application

on:
push:
paths:
- edc-chat-app-backend/*
branches:
- main
# trigger events for SemVer like tags
Expand All @@ -30,27 +32,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

# Needed to create multi-platfrom image
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},event=pr
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
- name: Build
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/build_frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Build docker image- frontend application

on:
push:
paths:
- edc-chat-app-ui/*
branches:
- main
# trigger events for SemVer like tags
Expand All @@ -17,7 +19,7 @@ on:


jobs:
build-docker-images-backend:
build-docker-images-frontend:
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -30,31 +32,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

# Needed to create multi-platfrom image
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},event=pr
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
- name: Build
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ./edc-chat-app-ui/Dockerfile
file: ./edc-chat-app-ui/Dockerfile-smartsense
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit 79aeae1

Please sign in to comment.