Skip to content

Commit 4bc892a

Browse files
committed
Added github workflow
1 parent 3dd8838 commit 4bc892a

3 files changed

Lines changed: 161 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build HTML from Markdown
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'datasets/*.md'
8+
- 'templates/*.html'
9+
- 'scripts/build.py'
10+
paths-ignore:
11+
- 'datasets/*.html'
12+
pull_request:
13+
branches: [ main, master ]
14+
paths:
15+
- 'datasets/*.md'
16+
- 'templates/*.html'
17+
- 'scripts/build.py'
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.11'
35+
36+
- name: Install dependencies
37+
run: |
38+
pip install -r requirements.txt
39+
40+
- name: Build HTML files
41+
run: |
42+
python scripts/build.py
43+
44+
- name: Commit changes
45+
if: github.event_name == 'push'
46+
run: |
47+
git config --local user.email "action@github.com"
48+
git config --local user.name "GitHub Action"
49+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
50+
git add datasets/*.html
51+
if git diff --staged --quiet; then
52+
echo "No changes to commit"
53+
else
54+
git commit -m "Auto-generate HTML from Markdown [skip ci]"
55+
git push
56+
fi
57+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
- name: Build with Jekyll
34+
uses: actions/jekyll-build-pages@v1
35+
with:
36+
source: ./
37+
destination: ./_site
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
41+
# Deployment job
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

‎.github/workflows/monitor.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Monitor New Datasets
2+
3+
on:
4+
# Schedule disabled - run manually via workflow_dispatch
5+
# schedule:
6+
# # Run every Monday at 00:00 UTC (weekly check)
7+
# - cron: '0 0 * * 1'
8+
workflow_dispatch: # Allow manual triggering
9+
10+
jobs:
11+
monitor:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
issues: write # If you want to create issues for new datasets
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install -r requirements.txt
28+
29+
- name: Run monitoring script
30+
run: |
31+
python scripts/monitor_datasets.py
32+
33+
- name: Upload monitoring results
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: monitoring-results
37+
path: |
38+
scripts/new_datasets.json
39+
scripts/monitor_state.json
40+
retention-days: 30
41+
42+
- name: Comment on workflow run (if new datasets found)
43+
if: success()
44+
run: |
45+
if [ -f scripts/new_datasets.json ]; then
46+
COUNT=$(python -c "import json; data=json.load(open('scripts/new_datasets.json')); print(len(data.get('results', [])))" 2>/dev/null || echo "0")
47+
if [ "$COUNT" -gt "0" ]; then
48+
echo "Found $COUNT potential new datasets. Check scripts/new_datasets.json for details."
49+
else
50+
echo "No new datasets found in this check."
51+
fi
52+
fi
53+

0 commit comments

Comments
 (0)