Skip to content

Add deploy workflow #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: deploy

on:
push:
tags:
- '*'

jobs:

pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Build
run: |
python setup.py bdist_wheel sdist --formats gztar
- name: Publish
if: success()
uses: pypa/gh-action-pypi-publish@v1.1.0
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

ghpages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r doc-requirements.txt
- name: Build
run: |
python -m mkdocs build --clean --verbose
- name: Publish
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.PAGES_DEPLOY_KEY }}
external_repository: Python-Markdown/Python-Markdown.github.io
publish_branch: master
publish_dir: ./site
25 changes: 15 additions & 10 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ along with a request for feedback.

Pull requests will generally not be accepted if any tests are failing.
Therefore, it is recommended that you run the tests before submitting your pull
request. After making a pull request, check the Travis build status in the
request. After making a pull request, check the build status in the
GitHub interface to ensure that all tests are running as expected. If any checks
fail, you may push additional commits to your branch. GitHub will add those
commits to the pull request and rerun the checks.
Expand Down Expand Up @@ -407,20 +407,25 @@ following steps:

Bump version to X.X.X

6. After all checks (Travis, etc.) have passed, merge the pull request.
6. After all checks have passed, merge the pull request.

7. Create a git tag with the new version as the tag name and push to the
[Python-Markdown/markdown] repository.
[Python-Markdown/markdown] repository. The new tag should trigger a GitHub
workflow which will automatically deploy the release to PyPI and update the
documentation.

8. Deploy the release to [PyPI] with the command `make deploy`.
In the event that the deployment fails, the following steps can be taken to
deploy manually:

9. Deploy an update to the documentation using [MkDocs]. The following example
assumes that local clones of the [Python-Markdown/markdown] and
[Python-Markdown/Python-Markdown.github.io] repositories are in sibling
directories named `markdown` and `Python-Markdown.github.io` respectively.
- Deploy the release to [PyPI] with the command `make deploy`.

cd Python-Markdown.github.io
mkdocs gh-deploy --config-file ../markdown/mkdocs.yml --remote-branch master
- Deploy an update to the documentation using [MkDocs]. The following example
assumes that local clones of the [Python-Markdown/markdown] and
[Python-Markdown/Python-Markdown.github.io] repositories are in sibling
directories named `markdown` and `Python-Markdown.github.io` respectively.

cd Python-Markdown.github.io
mkdocs gh-deploy --config-file ../markdown/mkdocs.yml --remote-branch master

## Issue and Pull Request Labels

Expand Down