summaryrefslogtreecommitdiff
path: root/.github/workflows/deploy.yml
blob: 7cf84cfb3dd9b2c6bfdc6de04b73c4db20e9aa1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 build
      - name: Build
        run: |
          python -m build
      - 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