Skip to content

Commit

Permalink
ci: Skip old frontend build if monorepo is present
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabelonogov committed Dec 20, 2023
1 parent 7c97c48 commit eaff2a6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,23 @@ jobs:
- name: Print Yarn cache size
run: du -d 0 -h ${{ steps.yarn-cache-dir-path.outputs.dir }}

- name: Build
run: |
yarn install --frozen-lockfile
yarn run build:production
working-directory: ${{ env.FRONTEND_OLD_DIR }}

- name: "Monorepo: Check"
id: monorepo-check
run: |
if [ -e '${{ env.FRONTEND_MONOREPO_DIR }}/package.json' ]; then
echo "monorepo_path=${{ env.FRONTEND_MONOREPO_DIR }}" >> $GITHUB_OUTPUT
else
echo "old_path=${{ env.FRONTEND_OLD_DIR }}" >> $GITHUB_OUTPUT
echo "::warning::Frontend Monorepo not found"
fi
- name: Build
if: steps.monorepo-check.outputs.old_path
run: |
yarn install --frozen-lockfile
yarn run build:production
working-directory: ${{ env.FRONTEND_OLD_DIR }}

- name: "Monorepo: Build"
if: steps.monorepo-check.outputs.monorepo_path
run: |
Expand All @@ -85,7 +87,7 @@ jobs:
- name: Commit and Push
run: |
git add "${{ env.FRONTEND_MONOREPO_DIR }}" || true
git add "${{ env.FRONTEND_OLD_DIR }}"
git add "${{ env.FRONTEND_OLD_DIR }}" || true
git status -s
git commit -m '${{ env.FRONTEND_BUILD_COMMIT_MESSAGE }}' -m 'Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' || true
git push origin HEAD

0 comments on commit eaff2a6

Please sign in to comment.