chore(deps): Bump lycheeverse/lychee-action from 1.10.0 to 2.1.0 #951
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: MkDocs | |
on: push | |
jobs: | |
mkdocs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DEPLOYMENT_PERSONAL_ACCESS_TOKEN }} | |
submodules: true | |
# git-revision-date-localized-plugin and mkdocs-rss-plugin need full git history depth | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Build docs | |
run: | | |
mkdocs -v build | |
- name: Upload meta descriptions artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: meta-descriptions | |
path: ./site/meta-descriptions.csv | |
- name: Validate generated HTML files | |
run: | | |
docker run -v $(pwd):/test --rm wjdp/htmltest --conf .htmltest.yml | |
# Deploy branch previews | |
- name: Obtain Netlify alias from branch name | |
id: branch | |
if: github.ref != 'refs/heads/master' | |
uses: common-fate/[email protected] | |
with: | |
max-length: 35 | |
- name: Deploy docs (branch preview) | |
if: github.ref != 'refs/heads/master' | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: ./site | |
production-branch: master | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: Deploy for branch ${{ github.ref_name }} | |
enable-pull-request-comment: false | |
enable-commit-comment: false | |
enable-commit-status: false | |
overwrites-pull-request-comment: false | |
alias: ${{ steps.branch.outputs.name }} | |
github-deployment-environment: Netlify | |
github-deployment-description: Branch deployment preview | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PERSONAL_ACCESS_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
# Deploy docs on push to master | |
- name: Set up environment variables | |
if: github.ref == 'refs/heads/master' | |
run: | | |
echo "MKDOCS_VERSION=$(mkdocs --version | cut -d " " -f 3)" >> $GITHUB_ENV | |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-9`" >> $GITHUB_ENV | |
echo "CUSTOM_DOMAIN=docs.pulse.codacy.com" >> $GITHUB_ENV | |
- name: Create robots.txt | |
if: github.ref == 'refs/heads/master' | |
run: | | |
echo -e "User-agent: *\nSitemap: https://${{ env.CUSTOM_DOMAIN }}/sitemap.xml" > "./site/robots.txt" | |
- name: Deploy docs | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.ref == 'refs/heads/master' | |
with: | |
personal_token: ${{ secrets.DEPLOYMENT_PERSONAL_ACCESS_TOKEN }} | |
publish_dir: ./site | |
destination_dir: ./ | |
keep_files: false | |
cname: ${{ env.CUSTOM_DOMAIN }} | |
allow_empty_commit: true | |
full_commit_message: Deployed ${{ env.SHORT_SHA }} to . with MkDocs ${{ env.MKDOCS_VERSION }} |