update(post): agentic coding flow #427
This file contains hidden or 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: Deploy Hugo site to Pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
baseURL: "https://smcleod.net" | |
jobs: | |
build: | |
if: github.repository == 'sammcj/smcleod' | |
strategy: | |
matrix: | |
environment: ['production'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
submodules: recursive | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: "0.148.1" | |
extended: true | |
- name: Setup Python and install uv | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 | |
with: | |
python-version: '3.11' | |
- name: Install uv (which provides uvx) | |
run: | | |
python -m pip install --upgrade pip | |
pip install uv | |
- name: Generate llms.txt files | |
run: | | |
# Remove any existing hugo_list.csv | |
rm -f hugo_list.csv | |
# Generate Hugo content list | |
hugo list all > hugo_list.csv | |
# Install and run hugo2llmtxt to generate both files | |
uvx --from hugo2llmtxt hugo2llmtxt hugo_list.csv static/llms.txt false | |
uvx --from hugo2llmtxt hugo2llmtxt hugo_list.csv static/llms-full.txt true | |
- name: Build | |
run: | | |
hugo \ | |
--minify \ | |
--baseURL "${{ env.baseURL }}" | |
env: | |
HUGO_ENVIRONMENT: ${{ matrix.environment }} | |
HUGO_ENV: ${{ matrix.environment }} | |
- name: Prepare tag | |
id: prepare_tag | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
TAG_NAME="${GITHUB_REF##refs/tags/}" | |
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT | |
echo "deploy_tag_name=deploy-${TAG_NAME}" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
with: | |
path: ./public | |
# Deploy job | |
deploy: | |
needs: build | |
if: github.ref == 'refs/heads/main' && github.repository == 'sammcj/smcleod' | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ env.baseURL }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 | |
# Deploy job | |
deploy-staging: | |
needs: build | |
if: github.ref == 'refs/heads/main' && github.repository == 'sammcj/smcleod-hugo' | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ env.baseURL }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |