Skip to content

Lock file maintenance #167

Lock file maintenance

Lock file maintenance #167

name: Init docs
on:
push:
branches:
- "[0-9]+.[0-9]+.x"
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
run: pip install -r docs/requirements.txt
- name: Set up git author
uses: oleksiyrudenko/gha-git-credentials@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup deploy key
env:
DEPLOY_DOCS_KEY: ${{ secrets.DEPLOY_DOCS_KEY }}
run: |
# Setup SSH deploy key
mkdir -p ~/.ssh
echo "${DEPLOY_DOCS_KEY}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H github.com > ~/.ssh/known_hosts
- run: git remote add doc git@github.com:patchlevel/laravel-event-sourcing-docs.git
- run: git fetch doc gh-pages --verbose
- run: |
mike deploy latest --config-file docs/mkdocs.yml --title="1.0 (latest)" --push --remote doc
- run: |
# Check if the "latest" alias exists
HAS_LATEST=$(mike list --config-file docs/mkdocs.yml --rebase --remote doc | grep latest) || true
# If so then it is set as the default version (to enable the index redirect)
if [ "${HAS_LATEST}" != "" ]
then
echo "Set latest as default"
mike set-default latest --config-file docs/mkdocs.yml --remote doc
fi