-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (79 loc) · 2.18 KB
/
main.yml
File metadata and controls
94 lines (79 loc) · 2.18 KB
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
name: Main
on:
workflow_dispatch:
inputs:
publish_artifacts:
description: "Publish artifacts (Y|N)"
required: true
default: "N"
release:
types: [published]
push:
branches:
- main
- dev
paths-ignore:
- README.md
pull_request:
branches:
- "*"
paths-ignore:
- README.md
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- name: Build and pack docs
run: |
./pack.sh
- name: Upload distribution package
uses: actions/upload-artifact@v4
with:
name: site
path: site.zip
publish:
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_artifacts == 'Y')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-pages
path: neoteroi
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: site
path: site
- name: Unzip artifact
run: |
unzip site/site.zip -d site
- name: Deploy to gh-pages branch
run: |
find neoteroi -mindepth 1 ! -name '.git' ! -name 'CNAME' ! -name 'README.md' ! -path 'neoteroi/.git/*' -exec rm -rf {} +
cp -r site/site/* neoteroi/
cd neoteroi
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Deploy documentation on $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
git push origin gh-pages
echo "Published to gh-pages"