Skip to content

Merge pull request #8 from airaghidavide/develop #25

Merge pull request #8 from airaghidavide/develop

Merge pull request #8 from airaghidavide/develop #25

---
name: deploy_website
on:
push:
branches:
- develop
- main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
pre-commit-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
shell: bash
- name: Verify Poetry installation
run: poetry --version
- name: Configure safe github directory
shell: bash
run: git config --global --add safe.directory /__w/website/website
- name: Install pre-commit check
shell: bash
run: poetry install --only dev --sync
- name: Run pre-commit check
shell: bash
run: poetry run pre-commit run -a
build:
needs: pre-commit-check
runs-on: ubuntu-latest
if: success()
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
shell: bash
- name: Verify Poetry installation
run: poetry --version
- name: Setup caching
uses: actions/cache@v3
with:
key: ${{ github.sha }}
path: .cache
- name: Install dependencies
run: poetry install
- name: Build MkDocs site
run: poetry run mkdocs build --clean --quiet --config-file mkdocs.yml
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2