Skip to content

Commit

Permalink
ci: dynamically build apps in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 17, 2023
1 parent be557d7 commit bdc9c54
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
core:
- core/**/*

ci:
- ci/**/*
- .github/**/*
Expand All @@ -10,3 +7,6 @@ dashboard:

consent:
- apps/consent/*

core:
- core/**/*
22 changes: 19 additions & 3 deletions .github/workflows/buck2-build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Buck2 build"

name: Buck2 build
on:
pull_request:
branches: [main]
types: [opened, synchronize, labeled, unlabeled]

jobs:
buck2-build:
Expand All @@ -13,5 +13,21 @@ jobs:
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Buck2 build args from labels
id: prepare_args
run: |
ARGS=""
for LABEL in ${{ github.event.pull_request.labels.*.name }}; do
case "$LABEL" in
dashboard|consent)
ARGS+=" //apps/$LABEL"
;;
core)
ARGS+=" //core/api"
;;
esac
done
echo "Prepared args: $ARGS"
echo "args=$ARGS" >> "$GITHUB_OUTPUT"
- name: Buck2 build
run: nix develop -c buck2 build //core/api:api
run: nix develop -c buck2 build ${{ steps.prepare_args.outputs.args }}

0 comments on commit bdc9c54

Please sign in to comment.