-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (47 loc) · 1.63 KB
/
build_catalog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Builds a users catalog based on the filter query provided in config.txt
name: Build catalog
on:
push:
branches: main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Uses Node.js to run the harvester
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install Node.js requirements
run: |
npm install xml2js
npm install node-fetch
# Uses Python to construct the query and parameterize JavaScripts
- name: Setup Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
# Builds the filter query from config.txt and inserts it into public/pasta.js and harvester/pasta_harvester.mjs
- name: Construct query and add to JavaScript
run: |
python main.py
# Runs harvester/pasta_harvester.mjs
- name: Run harvester
run: |
node ./harvester/pasta_harvester.mjs
# Commits the changes to the repository
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./public/pasta.js
git add ./harvester/pasta_harvester.mjs
git add ./public/pasta_lookup.js README.md
git diff-index --quiet HEAD || git commit -m "Configure ezCatalog"
# Pushes the changes to the repository
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main