-
Notifications
You must be signed in to change notification settings - Fork 44
124 lines (115 loc) · 3.58 KB
/
conda_and_docs_build.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
# -*- coding: utf-8 -*-
# Copyright 2021 United Kingdom Research and Innovation
# Copyright 2021 The University of Manchester
# 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.
# Authors:
# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt
name: conda_and_docs_build
on:
release:
types: [published]
push:
branches: [ master ]
tags:
- '**'
paths-ignore:
- 'CHANGELOG.md'
- 'CITATION.cff'
- 'LICENSE'
- 'scripts/**'
- 'NOTICE.txt'
- 'README.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'CHANGELOG.md'
- 'CITATION.cff'
- 'LICENSE'
- 'scripts/**'
- 'NOTICE.txt'
- 'README.md'
jobs:
conda_build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: conda-build
uses: paskino/conda-package-publish-action@v1.4.4
with:
subDir: 'recipe'
channels: '-c conda-forge -c intel -c astra-toolbox -c ccpi'
convert_win: false
convert_osx: false
test_pyver: 3.9
test_npver: 1.22
- name: Upload artifact of the conda package.
uses: actions/upload-artifact@v3.1.1
with:
name: cil-package
path: recipe/linux-64/cil*
docs_build:
needs: conda_build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: change directory
run: |
ls
- name: Download artifact of the conda package.
uses: actions/download-artifact@v3.0.1
with:
name: 'cil-package'
path: 'conda_package'
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
- uses: lauramurgatroyd/build-sphinx-action@v0.1.4
with:
DOCS_PATH: 'docs'
CONDA_BUILD_ENV_FILEPATH: 'docs/docs_environment.yml'
ARTIFACT_NAME: 'DocumentationHTML'
PACKAGE_FOLDER_PATH: 'conda_package'
PACKAGE_NAME: 'cil'
PACKAGE_CONDA_CHANNELS: 'conda-forge -c intel -c astra-toolbox -c ccpi'
BUILD_SUBDIR_NAME: 'nightly'
python_version: 3.9
docs_publish:
needs: docs_build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact of the html output.
uses: actions/download-artifact@v3.0.1
with:
name: DocumentationHTML
path: docs/build
- name: Commit documentation changes
run: |
git clone https://github.com/TomographicImaging/CIL.git --branch gh-pages --single-branch gh-pages
cp -r docs/build/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}