Skip to content

Commit

Permalink
Add package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Apr 5, 2024
1 parent c3ecb70 commit b7d9b88
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 27 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Package Nesis

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch'
required: true
default: main
tag:
description: 'Tag'
required: true
default: latest

jobs:
package_api:
name: API
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
file: ./nesis/api/Dockerfile
tags: ametnes/nesis:${{ github.event.inputs.tag }}-api

package_frontend:
name: Frontend
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.dockerfile_branch }}

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push frontend Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
file: ./nesis/frontend/Dockerfile
tags: ametnes/nesis:${{ github.event.inputs.tag }}-frontend
build-args: |
PUBLIC_URL=/
PROFILE=PROD
package_rag:
name: RAG
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.dockerfile_branch }}

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push RAG docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
file: ./nesis/rag/Dockerfile
tags: ametnes/nesis:${{ github.event.inputs.tag }}-rag
18 changes: 9 additions & 9 deletions .github/workflows/test_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Test API

on:
push:
# paths:
# - "nesis/api/core/**"
# - "nesis/api/tests/**"
# - "nesis/api/core/requirements*"
# pull_request:
# paths:
# - "nesis/api/core/**"
# - "nesis/api/tests/**"
# - "nesis/api/core/requirements*"
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"
pull_request:
paths:
- "nesis/api/core/**"
- "nesis/api/tests/**"
- "nesis/api/core/requirements*"

jobs:
linter:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Test Frontend

on:
push:
# paths:
# - "nesis/frontend/core/**"
# - "nesis/frontend/tests/**"
# - "nesis/frontend/core/requirements*"
# pull_request:
# paths:
# - "nesis/frontend/core/**"
# - "nesis/frontend/tests/**"
# - "nesis/frontend/core/requirements*"
paths:
- "nesis/frontend/client/**"
- "nesis/frontend/server/**"
pull_request:
paths:
- "nesis/frontend/client/**"
- "nesis/frontend/server/**"

jobs:
lint:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test_rag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Test Rag Engine

on:
push:
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"
# pull_request:
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
pull_request:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"

jobs:
linter:
Expand Down

0 comments on commit b7d9b88

Please sign in to comment.