-
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (53 loc) · 2.07 KB
/
update_madboulder.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
name: Update MadBoulder Website
on:
schedule:
- cron: "0 6 * * *" # Runs daily at 6 AM UTC
workflow_dispatch: # Allows manual trigger
jobs:
update-site:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ secrets.PYTHON_VERSION }}
- name: Create Secret Files
run: |
echo '${{ secrets.MADBOULDER_CHANNEL_JSON }}' > madboulder_channel.json
echo '${{ secrets.MADBOULDER_DEVELOPMENT_JSON }}' > madboulder-development.json
echo '${{ secrets.MADBOULDER_F1887F0310EC_ENV }}' > madboulder-f1887f0310ec.env
echo '${{ secrets.MADBOULDER_FILE_UPLOADER_ENV }}' > madboulder-file-uploader-5b2b9d6798b5.env
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Update Script
id: update_script
env:
FLASK_ENV: ${{ secrets.FLASK_ENV }}
MAILERLITE_API_KEY: ${{ secrets.MAILERLITE_API_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
WT_KEY: ${{ secrets.WT_KEY }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
YOUTUBE_API_KEY_HANDLE_DATA: ${{ secrets.YOUTUBE_API_KEY_HANDLE_DATA }}
run: |
python update_data_pages_sitemap.py
if [ $? -ne 0 ]; then
echo "Script failed"
exit 1
fi
echo "script_success=true" >> $GITHUB_OUTPUT
- name: Commit and Push Changes
if: steps.update_script.outputs.script_success == 'true'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add .
git commit -m "Auto-update templates" || echo "No changes to commit"
git push
- name: Trigger Render Deploy
if: steps.update_script.outputs.script_success == 'true'
run: |
curl -X POST "${{ secrets.RENDER_DEPLOY_HOOK }}"