chore: readme Usage #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate MQTT topics build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
library: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Run generator | |
run: | | |
sudo apt-get install -y graphviz | |
pip install -r requirements.txt | |
python3 src/generator/main.py . out | |
mkdir -p /tmp/workspace | |
cp -R out/* /tmp/workspace | |
- uses: actions/checkout@v2 | |
with: | |
ref: build | |
- name: Push generated files | |
id: commit | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git rm -r --ignore-unmatch */* | |
rm -rf * | |
cp -r /tmp/workspace/* . | |
git add . | |
if [[ $(git status --porcelain) ]]; then git commit -am "chore: automatically generated files" && git push; fi | |
echo "::set-output name=HASH::$(git rev-parse HEAD)" |