add workflow_dispatch event for gerrit hooks

Change-Id: I13feae8a8124b1114a1c5f1141cbf3d65ef1e08b
diff --git a/.github/workflows/gerrit.yml b/.github/workflows/gerrit.yml
new file mode 100644
index 0000000..0d5e97e
--- /dev/null
+++ b/.github/workflows/gerrit.yml
@@ -0,0 +1,43 @@
+name: gerrit checks
+
+on:
+  workflow_dispatch:
+    inputs:
+      ref:
+        type: string
+      gerrit-ref:
+        type: string
+      change:
+        type: string
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: lineageos-infra/fetch-gerrit-change@main
+        with:
+          repository: ${{ github.repository }}
+          gerrit-ref: ${{ inputs.gerrit-ref }}
+          ref: ${{ inputs.ref }}
+
+    - name: Setup JDK 17
+      uses: actions/setup-java@v3
+      with:
+        distribution: 'zulu'
+        java-version: 17
+
+    - name: Build with Gradle
+      run: ./gradlew assembleDebug
+
+    - name: Generate Android.bp
+      run: |
+        ./gradlew app:generateBp
+        if [[ ! -z $(git status -s) ]]; then
+          git status
+          exit -1
+        fi
+
+    - uses: actions/upload-artifact@v3
+      with:
+        name: app-debug.apk
+        path: app/build/outputs/apk/debug/app-debug.apk