Synced from knowledge-system: 2024-07-12 #714
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 Static HTML | |
on: | |
push: | |
branches: | |
- main # Set a branch that will trigger a deployment | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GENERAL_PAT }} | |
ssh-key: ${{ secrets.SSH_KEY }} | |
persist-credentials: true | |
submodules: true | |
- name: Checkout Website HTML | |
uses: actions/checkout@v3 | |
with: | |
repository: okwilkins/okwilkins.github.io | |
path: public | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Setup Miniconda using Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: personal-website | |
environment-file: environment.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
conda env update --file environment.yml | |
- name: Format Obsidian Markdown to Hugo Markdown | |
shell: bash -l {0} | |
run: | | |
conda activate personal-website | |
python ./personal_website/personal_website.py | |
- name: Generate Knowledge Graph JSON | |
shell: bash -l {0} | |
run: | | |
conda activate personal-website | |
python ./personal_website/knowledge_graph.py | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
# extended: true | |
- name: Build | |
run: hugo --minify --cleanDestinationDir --noBuildLock | |
- name: Deploy | |
run: | | |
cd ./public | |
echo "www.okwilkins.dev" > CNAME | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Synced from personal-website: $(date +%Y-%m-%d)" | |
git push origin -f HEAD:main |