-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (65 loc) · 1.84 KB
/
ci.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: ci
on:
push:
branches:
- main
workflow_dispatch:
jobs:
test:
name: run pytest
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Set up Python 3 ⚙️ 🐍
uses: actions/setup-python@v2
# run pytest
- run: pip install -r requirements.txt
- run: cd test; python -m pytest
# create & archive artifact
- run: python setup.py sdist
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist
!dist/**/*.md
release:
name: Upload release to PyPI and Deploy Github Pages
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mkdocs-obsidian-support-plugin
permissions: write-all
steps:
# retrieve artifact here
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: dist
- run: mkdir dist; mv mkdocs-obsidian-support-plugin-*.tar.gz dist
# publish it to pypi
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
gh-pages:
name: Deploy Github Pages
needs: release
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Set up Python 3 ⚙️ 🐍
uses: actions/setup-python@v2
- run: pip install -r requirements.txt
# deploy github pages
- run: pip install mkdocs-material
- run: pip install mkdocs-glightbox
- run: pip install mkdocs-awesome-pages-plugin
- run: pip install mkdocs-obsidian-support-plugin
- run: mkdocs gh-deploy --force