-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: index-rebuild | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
scrape: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Use Deno v2.x | ||
uses: denoland/setup-deno@v2 | ||
with: | ||
deno-version: v2.x | ||
|
||
- name: Generate bot token | ||
uses: actions/create-github-app-token@v1 | ||
id: maicon-token | ||
with: | ||
app-id: ${{ vars.MAICON_BOT_CLIENT_ID }} | ||
private-key: ${{ secrets.MAICON_BOT_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
repositories: | | ||
scraper | ||
archive | ||
- name: Checkout scraper repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: production | ||
token: ${{ steps.maicon-token.outputs.token }} | ||
|
||
- name: Checkout archive repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: rusbeapp/archive | ||
ref: main | ||
path: ./dist | ||
token: ${{ steps.maicon-token.outputs.token }} | ||
|
||
- name: Run scraper to rebuild index | ||
run: | | ||
deno task index-rebuild | ||
env: | ||
CI: true | ||
|
||
- name: Commit updates to archive repo | ||
run: | | ||
git config --global user.name "MaiconBot[bot]" | ||
git config --global user.email "191420508+maiconbot[bot]@users.noreply.github.com" | ||
git -C ./dist add . | ||
git -C ./dist diff-index --quiet HEAD || git -C ./dist commit -m "chore: update archive index" | ||
git -C ./dist push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"tasks": { | ||
"dev": "deno run --unsafely-ignore-certificate-errors=www.ufpe.br --watch src/main.ts", | ||
"start": "deno run --allow-net=www.ufpe.br --allow-write --allow-read --unsafely-ignore-certificate-errors=www.ufpe.br src/main.ts" | ||
"start": "deno run --allow-net=www.ufpe.br --allow-write --allow-read --unsafely-ignore-certificate-errors=www.ufpe.br src/main.ts", | ||
"index-rebuild": "deno run --allow-write --allow-read src/index-rebuild.ts" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { CURRENT_SCRAPER_VERSION } from './constants.ts'; | ||
import { saveScrapingOutput } from './file-management.ts'; | ||
|
||
console.log(`${CURRENT_SCRAPER_VERSION} - Starting index rebuild`) | ||
|
||
saveScrapingOutput([]); | ||
|
||
console.log(`${CURRENT_SCRAPER_VERSION} - Finished index rebuild`); |
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