Skip to content

Commit 46cef40

Browse files
authored
Merge pull request #8 from heroheman/feature/improve-github-actions
Feature/improve GitHub actions: Optimize GitHub Actions Workflow
2 parents bca4db5 + 3c80cde commit 46cef40

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/scp-items.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Crawl SCP Wiki
2+
3+
on:
4+
workflow_dispatch:
5+
# schedule:
6+
# - cron: "0 0 * * *"
7+
# push:
8+
# branches:
9+
# - main
10+
# paths:
11+
# - .github/workflows/scp-items.yml
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- .github/workflows/scp-items.yml
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
update-main-scp:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: "Checkout Crawler"
26+
uses: actions/checkout@v6
27+
28+
- name: "Clone API Repository"
29+
uses: actions/checkout@v6
30+
with:
31+
repository: heroheman/scp-api
32+
path: scp-api
33+
34+
- name: "Setup Python"
35+
uses: actions/setup-python@v6
36+
with:
37+
python-version: '3.13'
38+
39+
- name: "Install Crawler"
40+
run: make install
41+
42+
- name: "Crawl Titles"
43+
run: make data/scp_titles.json
44+
45+
- name: "Crawl Hubs"
46+
run: make data/scp_hubs.json
47+
48+
- name: "Crawl Items"
49+
run: make data/scp_items.json
50+
51+
- name: "Process Items"
52+
run: make data/processed/items
53+
54+
- name: "Crawl Tales"
55+
run: make data/scp_tales.json
56+
57+
- name: "Process Tales"
58+
run: make data/processed/tales
59+
60+
- name: "Crawl GOI"
61+
run: make data/goi.json
62+
63+
- name: "Process GOI"
64+
run: make data/processed/goi
65+
66+
- name: "Crawl Supplements"
67+
run: make data/scp_supplement.json
68+
69+
- name: "Process Supplements"
70+
run: make data/processed/supplement
71+
72+
- name: "Move Files into API"
73+
run: cp -Rf ./data/processed/* ./scp-api/docs/data/scp/
74+
75+
# - name: "Push"
76+
# shell: bash
77+
# run: >
78+
# cd scp-api;
79+
# ./bin/push.sh;
80+
81+
# env:
82+
# GIT_USER: "SCP Bot"
83+
# GIT_EMAIL: "scp@tedivm.com"

0 commit comments

Comments
 (0)