Merge pull request #5 from MHaggis/main #1
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 Site | |
on: | |
push: | |
branches: | |
- master | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Generate MD | |
run: python bin/generate_md.py | |
- name: Commit and push if it changed | |
run: | | |
git diff | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m "Generate markdown files" -a || echo "No changes to commit" | |
git push | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Deploy to GitHub Pages | |
run: | | |
cd HackerArt-io | |
mkdocs gh-deploy --force |