name: Deploy MkDocs on: push: branches: - main permissions: contents: write jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install Requirements run: | sudo apt-get update && sudo apt-get install pngquant && pip install -r requirements-doc.txt env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Fetch documentation branch run: git fetch origin gh-pages --depth=1 - name: Configure Git User run: | git config user.name "actions" git config user.email "actions@github.com" - name: Get current tag run: echo "version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - name: Build and deploy with mike run: mike deploy --update-aliases ${{ env.version }} latest --ignore-remote-status env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}