Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI docker fix #211

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions .github/workflows/mvn-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
run: |
cd ${{ inputs.COMPONENT_TYPE }}/wfprev-war/src/main/angular
npm install

- name: Build Angular app
if: ${{ inputs.COMPONENT_TYPE == 'client' }}
run: |
Expand All @@ -81,6 +82,13 @@ jobs:
- name: Copy built files to necessary folders
if: ${{ inputs.COMPONENT_TYPE == 'client' }}
run: mkdir -p staging && cp -r ${{ inputs.COMPONENT_TYPE }}/wfprev-war/src/main/angular/dist/wfprev/* staging/

- name: Upload Angular build artifact
if: ${{ inputs.COMPONENT_TYPE == 'client' }}
uses: actions/upload-artifact@v3
with:
name: angular-build
path: staging

- name: Build API with Maven
if: ${{ inputs.COMPONENT_TYPE == 'server' }}
Expand Down Expand Up @@ -129,6 +137,15 @@ jobs:
# with:
# ref: ${{ inputs.BRANCH }}

# Download Angular build artifact
- name: Download Angular build artifact
if: ${{ inputs.COMPONENT_TYPE == 'client' }}
uses: actions/download-artifact@v3
with:
name: angular-build
path: staging


- name: download artifact
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -164,12 +181,24 @@ jobs:
type=ref,event=tag
type=raw,value=${{ inputs.TAG }}

- name: Build and push Docker image
- name: Build and push Docker image for Client (UI)
if: ${{ inputs.COMPONENT_TYPE == 'client' }}
uses: docker/build-push-action@v6
with:
context: . # Root context to include the staging folder for client builds
build-args: |
CONTAINER_NAME=${{inputs.COMPONENT_NAME}}
push: true
tags: ${{ steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta_pr.outputs.labels }}

- name: Build and push Docker image for Server (API)
if: ${{ inputs.COMPONENT_TYPE == 'server' }}
uses: docker/build-push-action@v6
with:
context: ${{inputs.COMPONENT_TYPE}}/${{inputs.COMPONENT_NAME}}
build-args: |
CONTAINER_NAME=${{inputs.COMPONENT_NAME}}
push: true
tags: ${{ steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta_pr.outputs.labels }}
context: ${{ inputs.COMPONENT_TYPE }}/wfprev-api
build-args: |
CONTAINER_NAME=${{inputs.COMPONENT_NAME}}
push: true
tags: ${{ steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta_pr.outputs.labels }}
2 changes: 1 addition & 1 deletion client/wfprev-war/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM node:20-alpine
WORKDIR /app

# Copy the pre-built Angular app from the local machine into the container
COPY staging/* ./dist/wfprev
COPY ./staging/* ./dist/wfprev

# Copy backend files (for serving the Angular app using Express)
COPY backend /app
Expand Down
Loading