Skip to content

Commit

Permalink
Frontend build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Swapnil-Sagar committed Nov 4, 2024
1 parent aac7ca0 commit 14badc9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-enclave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- frontend-enclave
pull_request:
branches:
- master
- frontend-enclave

jobs:
build-enclave:
Expand Down Expand Up @@ -86,6 +88,7 @@ jobs:
fi
- name: Commit and push entrypoint.sh if created

run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
Expand All @@ -95,6 +98,36 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Frontend Code
run: |
if [ -d "webapp" ]; then
echo "webapp folder found. Starting frontend build..."
cd frontend
if [ "${{ inputs.package_manager || 'npm' }}" == "yarn" ]; then
yarn install
yarn build
else
npm install
npm run build
fi
else
echo "No frontend folder found, skipping frontend build."
fi
- name: Commit and push frontend build
run: |
if [ -d "frontend/build" ]; then
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add frontend/build
git commit -m "Add frontend build files" || echo "No changes to commit"
git push
else
echo "No frontend build folder found, skipping commit and push."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Run Enclave
run: |
docker build -t enclave .
Expand Down

0 comments on commit 14badc9

Please sign in to comment.