-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (73 loc) · 2.69 KB
/
Copy pathaction.yml
File metadata and controls
75 lines (73 loc) · 2.69 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
name: 'Webifier Build'
description: 'GitHub Action to build a static website and deploy on github pages'
author: 'webifier'
branding:
color: 'blue'
icon: 'cloud'
inputs:
repo:
description: 'GitHub repository of website material (default: $GITHUB_REPOSITORY)'
default: ${{ github.repository }}
required: false
baseurl:
description: >
Base URL (slug) of website (default: name of repository). You should set this field to "" if you are using
Webifier for building a github.io repository itself (in a `<username/organization>.github.io` repository ).
default: ${{ github.event.repository.name }}
required: false
index:
description: >
Entry index file (default: index.yml) change this if your entry index file is not named "index.yml" or is not
located in the root of your repository.
default: 'index.yml'
required: false
templates_dir:
description: >
Base directory to lookup custom jinja2 templates in (default: ".").
default: "."
required: false
publish_dir:
description: >
Where should the webified results end up (default: "./webified/")
default: "./webified/"
required: false
python-version:
description: >
Python version used to install and run Webifier.
default: "3.13"
required: false
extra-packages:
description: >
Additional pip packages to install before rendering, such as third-party Webifier extensions.
Use one package requirement per line, for example "my-webifier-extension" or
"my-extension @ git+https://github.com/me/my-extension.git".
default: ""
required: false
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- run: python -m pip install --upgrade pip
shell: bash
- run: python -m pip install --upgrade "webifier-extensions @ git+https://github.com/webifier/extensions.git" "webifier @ git+https://github.com/webifier/build.git"
shell: bash
- if: ${{ inputs.extra-packages != '' }}
env:
WEBIFIER_EXTRA_PACKAGES: ${{ inputs.extra-packages }}
run: |
python - <<'PY'
import os
import subprocess
import sys
packages = [
line.strip()
for line in os.environ["WEBIFIER_EXTRA_PACKAGES"].splitlines()
if line.strip()
]
subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", *packages])
PY
shell: bash
- run: webify --repo-full-name "${{ inputs.repo }}" --baseurl "${{ inputs.baseurl }}" --index ${{ inputs.index }} --output="${{ inputs.publish_dir }}" --templates-dir="${{ inputs.templates_dir }}"
shell: bash