-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.19 KB
/
deploy.yml
File metadata and controls
44 lines (36 loc) · 1.19 KB
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
name: Update docs/ directory via python script
on:
push:
branches:
- main # Triggers when commits or merges happen in main
paths:
- 'list.csv' # Triggers when the (input) list.txt file changes
- 'supplementary.json'
- 'base_script.py'
workflow_dispatch: # allow manual dispatch
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests Jinja2
- name: Run script to generate index.html
run: python base_script.py
- name: Commit changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add docs/
git diff --cached --quiet && echo "No changes to commit" || git commit -m "Update index.html via GitHub Actions"
- name: Push changes
if: success()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push