-
-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (79 loc) · 2.85 KB
/
validate.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Update Group Website
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
validating-article:
name: Validate Article
runs-on: ubuntu-latest
outputs:
validate-article-outcome: ${{ steps.validate-article.outcome }}
steps:
- name: Clone Tardis group data
uses: actions/checkout@v4
with:
repository: tardis-sn/tardis-org-data
path: tardis-org-data
token: ${{ secrets.RESEARCH_AND_NEWS }}
- name: Clone Research and News Repository
uses: actions/checkout@v4
with:
repository: tardis-sn/research_news
path: research_news
token: ${{ secrets.RESEARCH_AND_NEWS }}
- name: Set up Python3
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Update pip and install Jupyter and Pandas
run: |
pip install --upgrade pip jupyter pandas
- name: Run Validator Notebook
id: validate-article
run: |
ls -l -a
jupyter nbconvert --to python validate.ipynb
python3 validate.py > validation_output.txt
cat validation_output.txt
if grep -q "VALIDATION SUCCESSFUL" validation_output.txt; then
echo "Validation successful!"
else
echo "Validation failed!"
exit 1 # Set failure exit code
fi
working-directory: research_news
dispatch-to-websites:
name: Dispatch to All Websites
runs-on: ubuntu-latest
needs: validating-article
if: needs.validating-article.outputs.validate-article-outcome == 'success'
steps:
- name: Dispatch to Kerzendorf Lab Website
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.RESEARCH_AND_NEWS }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
-d '{ "event_type": "repo-push" }' \
https://api.github.com/repos/kerzendorf-lab/groupwebsite_generator/dispatches
- name: Dispatch to Tardis-org-data
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.RESEARCH_AND_NEWS }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
-d '{ "event_type": "repo-push" }' \
https://api.github.com/repos/tardis-sn/tardis-org-data/dispatches
- name: Dispatch to DTI website generator
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.RESEARCH_AND_NEWS }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
-d '{ "event_type": "repo-push" }' \
https://api.github.com/repos/deepthought-initiative/dtiwebsite_generator/dispatches