Update ink #62
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: Publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: "File linting" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install linter requirements | |
run: pip install -r requirements-lint.txt | |
- name: Run all pre-commit checks | |
run: | | |
pre-commit run --all-files --verbose --show-diff-on-failure | |
md-lint: | |
name: "Markdown linting" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Check out the code | |
- uses: actions/setup-node@v4 | |
name: Run md lint | |
with: | |
node-version: "18" | |
- run: npm install -g markdownlint-cli | |
- run: markdownlint "content/**/*.md" --disable MD013 | |
cspell: | |
name: "cspell" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Check out the code | |
- uses: actions/setup-node@v4 | |
name: Run spell check | |
with: | |
node-version: "18" | |
- run: npm install -g cspell | |
- run: cspell --config ./cspell.json --no-progress "content/**/*.md" | |
deploy: | |
runs-on: self-hosted | |
needs: [ lint, md-lint, cspell ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build | |
run: hugo --minify --enableGitInfo | |
- name: List directory structure | |
run: pwd && ls -ltR | |
- name: Deploy | |
run: rsync -rav ./public ./nginx/* /opt/blog |