-
-
Notifications
You must be signed in to change notification settings - Fork 4
176 lines (167 loc) · 6.4 KB
/
docs_deployer.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# 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' }}