mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: merge workflow optimized
This commit is contained in:
parent
eb3f53d787
commit
3f20a968af
33
.github/workflows/merge.yml
vendored
33
.github/workflows/merge.yml
vendored
@ -1,8 +1,8 @@
|
|||||||
name: Build and Push Docker Image On Merge
|
name: Build and Push Docker Images On Merge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
branches: ["main"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -12,6 +12,7 @@ jobs:
|
|||||||
frontend: ${{ steps.filter.outputs.frontend }}
|
frontend: ${{ steps.filter.outputs.frontend }}
|
||||||
api: ${{ steps.filter.outputs.api }}
|
api: ${{ steps.filter.outputs.api }}
|
||||||
widget: ${{ steps.filter.outputs.widget }}
|
widget: ${{ steps.filter.outputs.widget }}
|
||||||
|
nlu: ${{ steps.filter.outputs.nlu }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Filter paths
|
- name: Filter paths
|
||||||
@ -25,6 +26,8 @@ jobs:
|
|||||||
- 'api/**'
|
- 'api/**'
|
||||||
widget:
|
widget:
|
||||||
- 'widget/**'
|
- 'widget/**'
|
||||||
|
nlu:
|
||||||
|
- 'nlu/**'
|
||||||
|
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -39,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
id: docker_login
|
id: docker_login
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@ -47,7 +50,7 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push frontend Docker image
|
- name: Build and push Frontend Docker image
|
||||||
if: ${{ needs.paths-filter.outputs.frontend == 'true' }}
|
if: ${{ needs.paths-filter.outputs.frontend == 'true' }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@ -55,24 +58,34 @@ jobs:
|
|||||||
file: ./frontend/Dockerfile
|
file: ./frontend/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/hexabot-frontend:latest
|
tags: hexastack/hexabot-ui:latest
|
||||||
|
|
||||||
- name: Build and push API Docker image
|
- name: Build and push API Docker image
|
||||||
if: ${{ needs.paths-filter.outputs.api == 'true' }}
|
if: ${{ needs.paths-filter.outputs.api == 'true' }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./api/
|
||||||
file: ./api/Dockerfile
|
file: ./api/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/hexabot-api:latest
|
tags: hexastack/hexabot-api:latest
|
||||||
|
|
||||||
- name: Build and push widget Docker image
|
- name: Build and push Widget Docker image
|
||||||
if: ${{ needs.paths-filter.outputs.widget == 'true' }}
|
if: ${{ needs.paths-filter.outputs.widget == 'true' }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./widget/
|
||||||
file: ./widget/Dockerfile
|
file: ./widget/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/hexabot-widget:latest
|
tags: hexastack/hexabot-widget:latest
|
||||||
|
|
||||||
|
- name: Build and push NLU Docker image
|
||||||
|
if: ${{ needs.paths-filter.outputs.nlu == 'true' }}
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./nlu/
|
||||||
|
file: ./nlu/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: hexastack/hexabot-nlu:latest
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user