Skip to content

Commit

Permalink
Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
czerwonamaupa committed Feb 2, 2020
1 parent 9dfb63c commit fa6682f
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 421 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v6
- run: |
mkdir -p ~/.config/nixpkgs
echo '{ allowUnfree = true; }' > ~/.config/nixpkgs/config.nix
- uses: cachix/cachix-action@v3
with:
name: czerwonamaupa
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- uses: actions/upload-artifact@v1
with:
name: web
path: result
- uses: actions/upload-artifact@v1
with:
name: New-Introductory-Lectures-On-Psycho-Analysis.epub
path: result/ebooks
- uses: actions/upload-artifact@v1
with:
name: New-Introductory-Lectures-On-Psycho-Analysis.mobi
path: result/ebooks

gh-pages:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: web
path: .
- uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: web

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: New-Introductory-Lectures-On-Psycho-Analysis.epub
path: .
- uses: actions/download-artifact@v1
with:
name: New-Introductory-Lectures-On-Psycho-Analysis.mobi
path: .
- uses: softprops/action-gh-release@v1
with:
files: |
New-Introductory-Lectures-On-Psycho-Analysis.epub
New-Introductory-Lectures-On-Psycho-Analysis.mobi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/styles/ebook.css
/ebooks/*
/result
/*.css
/*.html
/*.zip
/*.mobi
/*.epub
24 changes: 24 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
with import <nixpkgs> {};
let
pandoc = import (fetchTarball {
url = "https://github.com/czerwonamaupa/pandoc/archive/413af81436a09f554a2ee575f063d8abed15ecd6.tar.gz";
sha256 = "1q7bc087ipp8bb0gf9yr29wh0mgvrb7ipsx3gcpi94ann2knykak";
}) {};
pythonInputs = python3.withPackages (pkgs: with pkgs; [pandocfilters pyphen]);
drv = stdenv.mkDerivation {
pname = "New-Introductory-Lectures-On-Psycho-Analysis";
version = "v1.5";
src = nix-gitignore.gitignoreSource [] ./.;
buildInputs = [ pandoc kindlegen pythonInputs ];
installPhase = ''
mkdir -p $out/web
cp -r {index.html,web.css,fonts} $out/web
mkdir -p $out/ebooks
cp New-Introductory-Lectures-On-Psycho-Analysis.{epub,mobi} $out/ebooks
'';
};
shell = mkShell {
inputsFrom = [ drv ];
buildInputs = [ entr ];
};
in drv // { inherit shell; }
403 changes: 0 additions & 403 deletions index.html

This file was deleted.

26 changes: 14 additions & 12 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
default : index.html ebooks/New-Introductory-Lectures-On-Psycho-Analysis.mobi
default : index.html New-Introductory-Lectures-On-Psycho-Analysis.mobi

index.html : New-Introductory-Lectures-On-Psycho-Analysis.md styles/index.css styles/html.css filters/* template.t
web.css : styles/index.css styles/html.css
cat styles/index.css > web.css && cat styles/html.css >> web.css

index.html : New-Introductory-Lectures-On-Psycho-Analysis.md web.css filters/* template.t
pandoc \
-s \
--filter filters/hyphenate.py \
--section-divs \
-o index.html \
-c styles/index.css \
-c styles/html.css \
-c web.css \
--template template.t \
New-Introductory-Lectures-On-Psycho-Analysis.md

styles/ebook.css : styles/index.css styles/epub.css
cat styles/index.css > styles/ebook.css && cat styles/epub.css >> styles/ebook.css
ebook.css : styles/index.css styles/epub.css
cat styles/index.css > ebook.css && cat styles/epub.css >> ebook.css

ebooks/New-Introductory-Lectures-On-Psycho-Analysis.epub : New-Introductory-Lectures-On-Psycho-Analysis.md styles/ebook.css filters/* template.t cover.png
New-Introductory-Lectures-On-Psycho-Analysis.epub : New-Introductory-Lectures-On-Psycho-Analysis.md ebook.css filters/* template.t cover.png
pandoc \
-s \
--filter filters/hyphenate.py \
--section-divs \
--toc-depth=1 \
--epub-cover-image cover.png \
-o ebooks/New-Introductory-Lectures-On-Psycho-Analysis.epub \
-c styles/ebook.css \
-o New-Introductory-Lectures-On-Psycho-Analysis.epub \
-c ebook.css \
--template template.t \
-t epub3 \
New-Introductory-Lectures-On-Psycho-Analysis.md

ebooks/New-Introductory-Lectures-On-Psycho-Analysis.mobi : ebooks/New-Introductory-Lectures-On-Psycho-Analysis.epub
kindlegen ebooks/New-Introductory-Lectures-On-Psycho-Analysis.epub
New-Introductory-Lectures-On-Psycho-Analysis.mobi : New-Introductory-Lectures-On-Psycho-Analysis.epub
kindlegen New-Introductory-Lectures-On-Psycho-Analysis.epub

clean :
$(RM) ebooks/* index.html styles/ebook.css
$(RM) index.html ebook.css web.css New-Introductory-Lectures-On-Psycho-Analysis.epub New-Introductory-Lectures-On-Psycho-Analysis.mobi
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ./.).shell
8 changes: 4 additions & 4 deletions styles/html.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@font-face
{ font-family: libertine;
src: url(../fonts/LinLibertine_R.woff); }
src: url(fonts/LinLibertine_R.woff); }

@font-face
{ font-family: libertine;
font-style: italic;
src: url(../fonts/LinLibertine_RI.woff); }
src: url(fonts/LinLibertine_RI.woff); }

@font-face
{ font-family: libertine;
font-weight: bold;
src: url(../fonts/LinLibertine_RB.woff); }
src: url(fonts/LinLibertine_RB.woff); }

@font-face
{ font-family: libertine;
font-weight: bold;
font-style: italic;
src: url(../fonts/LinLibertine_RBI.woff); }
src: url(fonts/LinLibertine_RBI.woff); }

body
{ font-family: libertine, serif; }
Expand Down

0 comments on commit fa6682f

Please sign in to comment.