diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0717e6..13880b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,7 @@ jobs: mv kindlegen /usr/bin cd book make bake + make website - name: Release baked book to S3 uses: shallwefootball/s3-upload-action@master with: @@ -27,10 +28,26 @@ jobs: aws_bucket: ${{ secrets.AWS_BUCKET }} source_dir: book/release destination_dir: release + - name: Release website + uses: shallwefootball/s3-upload-action@master + with: + aws_key_id: ${{ secrets.AWS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} + aws_bucket: ${{ secrets.AWS_BUCKET_WEBSITE }} + source_dir: book/html + destination_dir: static_html_root - name: Invalidate Cloudfront book cache uses: chetan/invalidate-cloudfront-action@v2 env: - DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION }} + DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_BOOK }} + PATHS: "/*" + AWS_REGION: "us-east-1" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Invalidate Cloudfront website cache + uses: chetan/invalidate-cloudfront-action@v2 + env: + DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_WEBSITE }} PATHS: "/*" AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} diff --git a/.gitignore b/.gitignore index 0fa1f03..03413a1 100644 --- a/.gitignore +++ b/.gitignore @@ -55,5 +55,6 @@ book_sans_serif/ book_serif/ release_sans_serif/ book/book_sans_serif-epub/ +book/static_website_html/ epub/ *.opf diff --git a/README.md b/README.md index a9a2cdb..2e4d7b0 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,10 @@ There's an additional enhanced accessibility version using a sans serif font: * [Download compiled .mobi version](https://www.the-bread-code.io/book-sans-serif.mobi) * [Download compiled .azw3 version](https://www.the-bread-code.io/book-sans-serif.azw3) +## Online HTML version (WIP) + +Head over to [https://www.the-sourdough-framework.com](https://www.the-sourdough-framework.com) + ## Hardcover version There is a hardcover version of the book available for purchase. [You can diff --git a/book/makefile b/book/makefile index 17d5fd0..e76c4c0 100644 --- a/book/makefile +++ b/book/makefile @@ -5,6 +5,7 @@ CLEAN := latexmk -cd -c -use-make EBOOK_CONVERT := kindlegen CHECK_1 := lacheck CHECK_2 := chktex +WEBSITE_DIR := static_website_html ifdef DEBUG EBOOK += -a debug @@ -218,6 +219,15 @@ release_sans_serif: build_sans_serif_pdf build_sans_serif_ebook | make_release_d cp epub/book_sans_serif.epub release/TheBreadCode-The-Sourdough-Framework-sans-serif.epub cp epub/book_sans_serif.azw3 release/TheBreadCode-The-Sourdough-Framework-sans-serif.azw3 +.PHONY: website +website: + if command -v cowsay &> /dev/null; then\ + cowsay "baking the website";\ + fi + rm -rf $(WEBSITE_DIR) + make4ht -uf html5+tidy+common_domfilters -d $(WEBSITE_DIR) book.tex + mv $(WEBSITE_DIR)/bookli1.html $(WEBSITE_DIR)/index.html + # Debug Stuff from now on .PHONY: show_tools_version show_tools_version: # Show version of tools used on the build machine