mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-03-16 21:40:24 +00:00
* updates URLs to Django 4 pattern * Checks for Ajax request using `x-requested-with` header * housekeeping * housekeeping * adds zlib to windows runs * uses specific python version * updates git URL * disables testing on Windows * changes docs path * changes docs path * changes docs path * Update documentations * removes docs Co-authored-by: GitHub Action <action@github.com>
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Deploy documentations to GitHub Pages
|
|
|
|
on:
|
|
release:
|
|
types: [ created ]
|
|
|
|
push:
|
|
branches: [ master, actions ]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Checkout branch
|
|
uses: actions/checkout@v2.3.2
|
|
|
|
- name: Restore docs environment
|
|
run: |
|
|
python dev.py -no-container --with-docs
|
|
mkdocs build
|
|
|
|
- name: Commit documentation changes
|
|
run: |
|
|
git clone https://github.com/neutronX/django-markdownx.git --branch gh-pages --single-branch gh-pages
|
|
rm -rf gh-pages/docs
|
|
mkdir gh-pages/docs
|
|
cp -r docs/* gh-pages/docs/
|
|
cd gh-pages
|
|
VERSION=$(python setup.py -V)
|
|
echo ${VERSION} >> version
|
|
> .nojekyll
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add .
|
|
git commit -m "Update documentations" -a || true
|
|
echo "Documentations for v${VERSION} has been deployed."
|
|
# The above command will fail if no changes were present, so we ignore
|
|
# the return code.
|
|
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
branch: gh-pages
|
|
directory: gh-pages
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|