Skip to content

Commit

Permalink
Deploy to GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jul 23, 2024
0 parents commit a336ae4
Show file tree
Hide file tree
Showing 154 changed files with 21,624 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
name: CI

on:
push:
branches:
- master

jobs:
build:

# https://github.com/actions/runner-images
runs-on: ubuntu-latest

steps:

- name: Install Calibre
run: |
sudo apt update
sudo apt install calibre # for `ebook-convert` command
# https://github.com/actions/setup-node
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v2

# https://github.com/honkit/honkit
- name: Run Honkit
run: |
npm install honkit --save-dev
npx honkit build . public --log=debug
npx honkit pdf . byte-of-python.pdf
npx honkit epub . byte-of-python.epub
# https://github.com/crazy-max/ghaction-github-pages
- name: Push to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: public
fqdn: python.swaroopch.com
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/actions/create-release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.sha }}
release_name: Release v${{ github.sha }}
draft: false
prerelease: false

# https://github.com/actions/upload-release-asset
- name: Upload Release PDF
id: upload-release-pdf
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include
# a `upload_url`. See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./byte-of-python.pdf
asset_name: byte-of-python.pdf
asset_content_type: application/pdf

# https://github.com/actions/upload-release-asset
- name: Upload Release EPUB
id: upload-release-epub
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include
# a `upload_url`. See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./byte-of-python.epub
asset_name: byte-of-python.epub
asset_content_type: application/epub+zip
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_book
*.pyc
.*.sw*
byte_of_python.html
byte_of_python.xml
byte_of_python.pdf
byte_of_python.epub
byte_of_python.mobi
node_modules
byte-of-python.epub
byte-of-python.pdf
package-lock.json
package.json
public
venv
.vscode
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python.swaroopch.com
21 changes: 21 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```
# install node.js
# see https://nodejs.dev/learn/how-to-install-nodejs
# install honkit
npm install honkit --save-dev
# show website running locally
npx honkit serve
# generate website files
npx honkit build . public --log=debug
# generate pdf
npx honkit pdf . byte-of-python.pdf
# generate epub
npx honkit epub . byte-of-python.epub
```

See https://github.com/honkit/honkit and https://honkit.netlify.app/
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://github.com/honkit/honkit
setup:
npm install honkit --save-dev

build:
npx honkit build . public --log=debug

pdf:
npx honkit pdf . byte-of-python.pdf

epub:
npx honkit epub . byte-of-python.epub

serve:
npx honkit serve
Loading

0 comments on commit a336ae4

Please sign in to comment.