-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from Amndeep7/generate_workflow
Workflow to automatically regenerate /docs on every push to master and pr
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Regenerate /docs using the generate_*.py scripts | ||
|
||
on: | ||
pull_request_target: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
regenerate: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Pull down repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.head_ref }} | ||
- name: Clean /docs/analytics | ||
shell: bash | ||
run: rm -rfv ./docs/analytics | ||
- name: Clean /docs/sensors | ||
shell: bash | ||
run: rm -rfv ./docs/sensors | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Install script dependencies | ||
run: pip install -r ./scripts/requirements.txt | ||
- name: Regenerate analytics | ||
working-directory: ./scripts | ||
run: python generate_analytics.py | ||
- name: Regenerate sensors | ||
working-directory: ./scripts | ||
run: python generate_sensors.py | ||
- name: Regenerate attack nav layer | ||
working-directory: ./scripts | ||
run: python generate_attack_nav_layer.py | ||
- name: Commit new static site | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'Automated commit to rebuild the static site' | ||
commit_options: '--signoff' | ||
commit_user_name: 'Build and Push Automation Script' | ||
commit_user_email: '<>' |