Skip to content

Commit

Permalink
add building of frontend to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitj committed Sep 27, 2023
1 parent 74c8053 commit f880012
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/afids-validator_ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: AFIDs Validator CI Workflow

on:
pull_request:
pull_request_target:
types: [opened, reopened, synchronize, ready_for_review, closed]

jobs:
Expand Down Expand Up @@ -74,8 +74,48 @@ jobs:
- name: pylint
run: poetry run pylint afidsvalidator test

assign-reviewer:
build-frontend:
needs: [linting]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: action/checkout@v4

- name: Cache node installation
uses: actions/cache@v3
with:
path: ~/.local
key: ${{ runner.os }}-node-${{ github.event.pull_request.id }}

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install react dependencies
run: |
npm --prefix afidsvalidator/static/lib/afidsvalidator-react install
- name: Build react frontend
run: |
npm run --prefix afidsvalidator/static/lib/afidsvalidator-react build
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "[BOT] Build react frontend" -a
- name: Push to repo
uses: CasperWA/push-protected@v2
with:
branch: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.BP_PAT_TOKEN }}
unprotect_reviews: true

assign-reviewer:
needs: [build-frontend]
if: github.event.pull_request.assignee == null
uses: khanlab/actions/.github/workflows/[email protected]

Expand Down

0 comments on commit f880012

Please sign in to comment.