This firebase function scrapes feedback from soloproject-evaluation using Puppeteer.
For Puppeteer to work with firebase functions,
- Make sure enough memory is allocated (512Mb in this case)
- Use Puppeteer
16.2.0
. Version 18 might work according to some reports. However, the latest version (21), does not work. .puppeteerrc.cjs
to configure cache"gcp-build": "node node_modules/puppeteer/install.js"
to add a custom build step
The function does 4 things
- Scrapes the Github repo for feedback
- Stores the json file in firebase store
- Revalidates feedback tags in the next.js Evaluation app https://chingu-soloproject-evaluation-app.vercel.app/ https://github.com/cherylli/chingu-soloproject-evaluation-app
- Returns the scrape results (in JSON)
Github workflow to initiate scraping when the soloproject-evalution
repo is updated
on:
push
jobs:
trigger-firebase-functions:
runs-on: ubuntu-latest
steps:
- name: Trigger Firebase Functions
id: getRequest
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.FUNCTION_URL }}
method: 'GET'
timeout: 50000
- name: Show Response
run: |
echo ${{ steps.getRequest.outputs.response }}