Skip to content

Commit 4434b9e

Browse files
committed
feat: add gh-pages workflow
1 parent fa15b46 commit 4434b9e

538 files changed

Lines changed: 63 additions & 35415 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gh-pages.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# GitHub workflow for generating test files and deploying to gh-pages
2+
3+
name: Generate Test Files and Deploy to gh-pages
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push to main branch
8+
push:
9+
branches: [ main ]
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build-and-deploy"
16+
build-and-deploy:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
22+
# Steps represent a sequence of tasks that will be executed as part of the job
23+
steps:
24+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25+
- uses: actions/checkout@v2
26+
27+
# Sets up python
28+
- uses: actions/setup-python@v2
29+
with:
30+
python-version: 3.10
31+
32+
# Install dependencies
33+
- name: "Installs dependencies"
34+
run: |
35+
python3 -m pip install --upgrade pip
36+
python3 -m pip install setuptools wheel tqdm minify-html watchdog
37+
38+
# Build and install the project
39+
- name: "Builds and installs the project"
40+
run: |
41+
python3 setup.py sdist bdist_wheel
42+
python3 -m pip install -e . --break-system-packages
43+
44+
# Generate test files
45+
- name: "Generates test files"
46+
run: |
47+
# Check if there are any EPUB files in examples directory
48+
if [ -z "$(ls -A examples/*.epub 2>/dev/null)" ]; then
49+
echo "No EPUB files found in examples directory"
50+
exit 1
51+
fi
52+
# Generate test files
53+
epub-browser ./examples --no-server --output-dir ./test --keep-files
54+
55+
# Deploy to gh-pages
56+
- name: "Deploys to gh-pages"
57+
uses: peaceiris/actions-gh-pages@v3
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
publish_dir: ./test
61+
publish_branch: gh-pages
62+
force_orphan: true
63+
commit_message: "Update test files"
2.78 MB
Binary file not shown.

0 commit comments

Comments
 (0)