📝 Docs: Minor Teaks. #195
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
# Copyright (c) 2021 Abhishek Thakur(@abhiTronix) <[email protected]> | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: DeFFcode Docs Deployer | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
release: | |
types: [published] | |
env: | |
PYTHON_VERSION: 3.9 | |
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | |
GIT_NAME: ${{ secrets.GIT_NAME }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
jobs: | |
deploy-docs-release: | |
name: Deploy Release Docs | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install_deffcode | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
pip install . | |
if: success() | |
- name: install_docs_deps | |
run: | | |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin | |
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy | |
pip install jinja2==3.0.* | |
if: success() | |
- name: git configure | |
run: | | |
REMOTE="https://${GIT_TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
git config --global user.name "${GIT_NAME}" | |
git config --global user.email "${GIT_EMAIL}" | |
git remote set-url origin ${REMOTE} | |
if: success() | |
- name: Release name_configure | |
run: | | |
echo "RELEASE_NAME=$(python -c 'import deffcode; print(deffcode.__version__)')" >>$GITHUB_ENV | |
shell: bash | |
if: success() | |
- name: Check deploy Skip | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
- name: mike deploy docs release | |
run: | | |
echo "${{ env.NAME_RELEASE }}" | |
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_RELEASE }} ${{ env.RELEASE_NAME }} --title=${{ env.RELEASE_NAME }} | |
env: | |
NAME_RELEASE: "v${{ env.RELEASE_NAME }}-release" | |
if: success() && ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
deploy-docs-stable: | |
name: Deploy Latest Docs | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install_deffcode | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
pip install . | |
if: success() | |
- name: install_docs_deps | |
run: | | |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin | |
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy | |
pip install jinja2==3.0.* | |
if: success() | |
- name: git configure | |
run: | | |
REMOTE="https://${GIT_TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
git config --global user.name "${GIT_NAME}" | |
git config --global user.email "${GIT_EMAIL}" | |
git remote set-url origin ${REMOTE} | |
if: success() | |
- name: Release name_configure | |
run: | | |
echo "RELEASE_NAME=$(python -c 'import deffcode; print(deffcode.__version__)')" >>$GITHUB_ENV | |
shell: bash | |
if: success() | |
- name: Check deploy Skip | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
- name: mike deploy docs stable | |
run: | | |
echo "${{ env.NAME_STABLE }}" | |
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_STABLE }} latest --title=latest | |
mike set-default --push latest | |
env: | |
NAME_STABLE: "v${{ env.RELEASE_NAME }}-stable" | |
if: success() && ${{ steps.skip_check.outputs.should_skip != 'true' }} | |
deploy-docs-dev: | |
name: Deploy Development Docs | |
if: github.event_name == 'push' && github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- run: git checkout dev | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: install_deffcode | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
pip install . | |
if: success() | |
- name: install_docs_deps | |
run: | | |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin | |
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy | |
pip install jinja2==3.0.* | |
if: success() | |
- name: git configure | |
run: | | |
REMOTE="https://${GIT_TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
git config --global user.name "${GIT_NAME}" | |
git config --global user.email "${GIT_EMAIL}" | |
git remote set-url origin ${REMOTE} | |
if: success() | |
- name: Release name_configure | |
run: | | |
echo "RELEASE_NAME=$(python -c 'import deffcode; print(deffcode.__version__)')" >>$GITHUB_ENV | |
shell: bash | |
if: success() | |
- name: Check deploy Skip | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
concurrent_skipping: 'never' | |
skip_after_successful_duplicate: 'true' | |
- name: mike deploy docs dev | |
run: | | |
echo "Releasing ${{ env.NAME_DEV }}" | |
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_DEV }} dev --title=dev | |
env: | |
NAME_DEV: "v${{ env.RELEASE_NAME }}-dev" | |
if: success() && ${{ steps.skip_check.outputs.should_skip != 'true' }} |