chore: fix github output #5
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: Check Affected | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
check-affected: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.11.0' | |
cache: 'pnpm' | |
- uses: nrwl/nx-set-shas@v3 | |
with: | |
main-branch-name: ${{ github.event.pull_request.base.ref || github.ref_name }} | |
- name: ziyo-fe check | |
id: check-ziyo-fe | |
run: | | |
if pnpm nx show projects --affected | grep -q "ziyo-fe" | |
then | |
echo "build=yes" >> "$GITHUB_OUTPUT" | |
else | |
echo "build=no" >> "$GITHUB_OUTPUT" | |
fi | |
- name: ziyo-be check | |
id: check-ziyo-be | |
run: | | |
if pnpm nx show projects --affected | grep -q "ziyo-be" | |
then | |
echo "build=yes" >> "$GITHUB_OUTPUT" | |
else | |
echo "build=no" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Invoke ziyo-fe build | |
if: steps.check-ziyo-fe.outputs.build == 'yes' | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: build-deploy.yml | |
inputs: '{ "image-name": "ziyo-fe" }' | |
- name: Invoke ziyo-be build | |
if: steps.check-ziyo-be.outputs.build == 'yes' | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: build-deploy.yml | |
inputs: '{ "image-name": "ziyo-be" }' |