-
Notifications
You must be signed in to change notification settings - Fork 209
55 lines (50 loc) · 1.82 KB
/
build-template.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
name: 🏗️ Build + Publish templates.json file
on:
workflow_dispatch:
push:
branches: [ main ]
schedule:
- cron: '0 2 * * 0' # At 02:00 on Sunday
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout repository 🛎️
uses: actions/checkout@v2
# Get current date-time (used for commit message)
- name: Get Date 📅
id: date
run: echo "::set-output name=date::$(date +'%d-%b-%Y')"
# Downloads + installs Python (used for running gen scripts)
- name: Set up Python 🐍
uses: actions/setup-python@v2
with:
python-version: '3.x'
# Install contents of requirements.txt
- name: Install dependencies 📥
run: |
python -m pip install --upgrade pip
cd lib && pip install -r requirements.txt
# The make command triggers all the Python scripts, generates output
- name: Run make command 🔨
run: make
# Commit and push the outputed JSON files
- name: Commit and push generated files ⤴️
run: |
git config --global user.name "Liss-Bot"
git config --global user.email "[email protected]"
git add templates.json
if git diff --staged --quiet; then
echo "Nothin new added, so nothing to commit, exiting..."
else
git commit -m "Updates templates (auto-generated, on ${{ steps.date.outputs.date }})"
git push
fi
git add .github/README.md
if git diff --staged --quiet; then
echo "No need to update README, skipping..."
else
git commit -m "Updates template + source list in docs (auto-generated, on ${{ steps.date.outputs.date }})"
git push
fi