From bd05dfdb662705af2020ba07393f167b438cd848 Mon Sep 17 00:00:00 2001 From: Giulio Menna Date: Thu, 7 Mar 2024 20:55:36 +0100 Subject: [PATCH] Create ci.yml feat(ci): add GitHub Actions CI workflow for MkDocs deployment This commit introduces a new CI workflow defined in `ci.yml`, designed to automate the deployment of MkDocs documentation to GitHub Pages. The workflow is triggered on pushes to the `master` and `main` branches. It includes steps for checking out the repository, configuring Git credentials for GitHub Actions, setting up Python, caching dependencies, and deploying the site using `mkdocs gh-deploy --force`. This setup ensures that the documentation is automatically built and deployed, facilitating continuous integration and deployment processes. Signed-off-by: Giulio Menna --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c2c5331 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: pip install mkdocs-glightbox + - run: mkdocs gh-deploy --force +