-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: 🤖 Rewrite the documentation CI
- Loading branch information
1 parent
02f961f
commit 18084cd
Showing
1 changed file
with
35 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
--- | ||
name: ci | ||
# SPDX-FileCopyrightText: 2023 The MalwareTracesGenerator development team | ||
# | ||
# SPDX-License-Identifier: CC0-1.0 | ||
name: Build and deploy the documentation | ||
on: | ||
push: | ||
branches: [main] | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
build: | ||
name: Build the documentation | ||
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@v5 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
python-version: '3.13' | ||
cache: pip | ||
- name: Install Material for MkDocs | ||
run: pip install mkdocs-material | ||
- name: Build MkDocs website | ||
run: mkdocs build | ||
- name: Setup Github Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force | ||
path: ./site | ||
deploy: | ||
name: Deploy the documentation | ||
permissions: | ||
pages: write | ||
id-token: write | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 |