Skip to content

Commit b7d6429

Browse files
authored
Add deploy workflow (#971)
1 parent 92ac78b commit b7d6429

File tree

2 files changed

+68
-10
lines changed

2 files changed

+68
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
10+
pypi:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup Python
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.7
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip setuptools wheel
21+
- name: Build
22+
run: |
23+
python setup.py bdist_wheel sdist --formats gztar
24+
- name: Publish
25+
if: success()
26+
uses: pypa/gh-action-pypi-publish@v1.1.0
27+
with:
28+
user: __token__
29+
password: ${{ secrets.PYPI_PASSWORD }}
30+
31+
ghpages:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Setup Python
36+
uses: actions/setup-python@v1
37+
with:
38+
python-version: 3.7
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip setuptools
42+
python -m pip install -r doc-requirements.txt
43+
- name: Build
44+
run: |
45+
python -m mkdocs build --clean --verbose
46+
- name: Publish
47+
if: success()
48+
uses: peaceiris/actions-gh-pages@v3
49+
with:
50+
deploy_key: ${{ secrets.PAGES_DEPLOY_KEY }}
51+
external_repository: Python-Markdown/Python-Markdown.github.io
52+
publish_branch: master
53+
publish_dir: ./site

docs/contributing.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ along with a request for feedback.
9494

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

408408
Bump version to X.X.X
409409

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

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

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

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

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

425430
## Issue and Pull Request Labels
426431

0 commit comments

Comments
 (0)