Skip to content

Commit f31af47

Browse files
committed
Clean-up workflow
1 parent cde11b3 commit f31af47

File tree

1 file changed

+95
-30
lines changed

1 file changed

+95
-30
lines changed

.github/workflows/pages.yml

Lines changed: 95 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,104 @@
1+
#/
2+
# @license MIT
3+
#
4+
# Copyright (c) 2022 Python Data APIs Consortium.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
#/
24+
25+
# Workflow name:
26+
name: gh_pages
27+
28+
# Workflow triggers:
129
on:
230
push:
331
branches:
432
- main
33+
534
pull_request:
635
branches:
7-
- "**"
36+
- "**"
37+
38+
# Workflow jobs:
839
jobs:
9-
run:
10-
# Don't run Action on forks, and allow skipping CI
40+
41+
# Define a job for publishing to the gh-pages branch...
42+
publish:
43+
44+
# Define a display name:
45+
name: 'Publish'
46+
47+
# Define the type of virtual host machine:
48+
runs-on: ubuntu-latest
49+
50+
# Avoid running this workflow for forks and allow skipping CI:
1151
if: "github.repository == 'data-apis/array-api' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
12-
runs-on: ubuntu-18.04
52+
53+
# Define a sequence of job steps...
1354
steps:
14-
# - uses: docker://pandoc/latex:2.9
15-
- uses: actions/checkout@master
16-
- uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.10.2' # Version range or exact version of a Python version to use, using semvers version range syntax.
19-
architecture: 'x64' # (x64 or x86)
20-
- run: |
21-
# add dependencies based on the conf.py
22-
pip install -r requirements.txt
23-
- name: Build docs
24-
run: |
25-
# Turn warnings into errors; ensure .doctrees doesn't get deployed
26-
sphinx-build -b html -WT --keep-going spec build/latest -d doctrees
27-
touch build/.nojekyll
28-
- uses: actions/upload-artifact@v2
29-
if: ${{ github.event_name == 'pull_request'}}
30-
with:
31-
name: html
32-
path: build/
33-
if-no-files-found: error
34-
- name: Deploy
35-
if: ${{ github.ref == 'refs/heads/main'}}
36-
uses: peaceiris/actions-gh-pages@v3
37-
with:
38-
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: ./build
55+
56+
# Checkout the repository:
57+
- name: 'Checkout repository'
58+
uses: actions/checkout@v2
59+
with:
60+
# Specify whether to remove untracked files before checking out the repository:
61+
clean: false
62+
63+
# Limit clone depth to the most recent commit:
64+
fetch-depth: 1
65+
66+
# Specify whether to download Git-LFS files:
67+
lfs: false
68+
timeout-minutes: 10
69+
70+
# Install Python:
71+
- name: 'Install Python'
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: '3.10.2'
75+
architecture: 'x64'
76+
77+
# Install dependencies:
78+
- name: 'Install dependencies'
79+
run: |
80+
pip install -r ./requirements.txt
81+
82+
# Generate the documentation:
83+
- name: 'Build documentation'
84+
run: |
85+
# Turn warnings into errors; ensure .doctrees doesn't get deployed
86+
sphinx-build -b html -WT --keep-going spec build/latest -d doctrees
87+
touch build/.nojekyll
88+
89+
# Upload the build artifact:
90+
- name: 'Upload build artifact'
91+
uses: actions/upload-artifact@v2
92+
if: ${{ github.event_name == 'pull_request'}}
93+
with:
94+
name: html
95+
path: build/
96+
if-no-files-found: error
97+
98+
# Deploy the build artifact to gh-pages:
99+
- name: 'Deploy'
100+
uses: peaceiris/actions-gh-pages@v3
101+
if: ${{ github.ref == 'refs/heads/main'}}
102+
with:
103+
github_token: ${{ secrets.GITHUB_TOKEN }}
104+
publish_dir: ./build

0 commit comments

Comments
 (0)