Skip to content

Fix minor typo

Fix minor typo #292

name: Deploy to GitHub Pages
on:
push:
branches:
- main
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Linting job
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: Install dependencies
run: pip install --requirement requirements.txt --requirement requirements-freeze.txt
- name: Lint
run: mdwrap --check docs
# Build Material for MkDocs job
build-material-for-mkdocs:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install Material for MkDocs dependencies
run: |
sudo apt install --yes \
libcairo2-dev \
libfreetype6-dev \
libffi-dev \
libjpeg-dev \
libpng-dev \
libz-dev
pip install \
cairosvg \
mkdocs-material \
mkdocs-minify-plugin \
mkdocs-git-revision-date-localized-plugin \
mkdocs-glightbox \
pillow
- name: Build Material for MkDocs
run: |
mkdocs build --site-dir public
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: material-for-mkdocs-files
path: |
public
if-no-files-found: error
retention-days: 1
# Build Marp job
build-marp:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build presentation (content) with Marp (HTML)
uses: docker://marpteam/marp-cli:v3.0.2
with:
args: --config .github/workflows/marp.config.js --html --output "presentation/index.html" "presentation/README.md"
env:
MARP_USER: root:root
- name: Build presentation (about us) with Marp (HTML)
uses: docker://marpteam/marp-cli:v3.0.2
with:
args: --config .github/workflows/marp.config.js --html --output "presentation/about.html" "presentation/ABOUT.md"
env:
MARP_USER: root:root
- name: Build presentation (content) with Marp (PDF)
uses: docker://marpteam/marp-cli:v3.0.2
with:
args: --config .github/workflows/marp.config.js --html --allow-local-files --jpeg-quality 100 --pdf --output "presentation/a-guide-to-mlops-presentation.pdf" "presentation/README.md"
env:
MARP_USER: root:root
- name: Build presentation (about us) with Marp (PDF)
uses: docker://marpteam/marp-cli:v3.0.2
with:
args: --config .github/workflows/marp.config.js --html --allow-local-files --jpeg-quality 100 --pdf --output "presentation/a-guide-to-mlops-about-us.pdf" "presentation/ABOUT.md"
env:
MARP_USER: root:root
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: marp-files
path: |
presentation/images
presentation/a-guide-to-mlops-presentation.pdf
presentation/a-guide-to-mlops-about-us.pdf
presentation/index.html
presentation/about.html
if-no-files-found: error
retention-days: 1
merge-files-for-github-pages:
runs-on: ubuntu-latest
needs: [build-material-for-mkdocs, build-marp]
steps:
- name: Download files
uses: actions/download-artifact@v4
with:
pattern: "*-files"
- name: Merge files
run: |
# Copy Material for MkDocs files to the `public` directory
mv material-for-mkdocs-files public
# Check if the `presentation` directory exists in the `public` directory
if [ -d "presentation" ]; then
echo "The 'presentation' directory already exists in the `public` directory"
exit 1
fi
# Move the Marp files to the `presentation` directory
mv marp-files public/presentation
- name: Upload files to GitHub Pages
# Only run on main
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Deployment job
deploy:
runs-on: ubuntu-latest
needs: merge-files-for-github-pages
# Only run on main
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4