WIP calculate changed apps #435
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "test-monorepo-build" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: deploy | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v4 | |
with: | |
workflow-id: deploy | |
main-branch-name: "master" | |
- run: | | |
echo "BASE: ${{ env.NX_HEAD }}" | |
- name: Install pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm -r install | |
- name: Check apps changed since the last successful commit | |
run: | | |
changedApps=$(pnpm -r -F '[${{ env.NX_HEAD }}]' ls --depth -1 -j \ | |
\| jq -r '.[] \ | |
\| select(.path | contains("apps/")) | .name' \ | |
\| xargs -I {} echo -n "-F '{}' ") | |
echo "Changed apps: $changedApps" | |
pnpm build -r $changedApps | |
exit 1 |