Merge remote-tracking branch 'northern/master' #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [master] | |
tags: ["v*"] | |
pull_request_target: | |
branches: [master] | |
jobs: | |
html: | |
runs-on: ubuntu-latest | |
name: html | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Make output | |
run: mkdir -p out/html | |
- name: Copy images | |
run: cp -r images html/book.css out/html/ | |
- name: cat files | |
id: files | |
run: | | |
FILES=$(cat filelist.txt) | |
echo "::set-output name=input_files::$FILES" | |
- name: pandoc html | |
uses: docker://pandoc/core:2 | |
with: | |
entrypoint: /usr/local/bin/pandoc | |
args: '--to html5+smart -o out/html/black-book.html --section-divs --toc --standalone --template=html/template.html ${{ steps.files.outputs.input_files }}' | |
- name: rename index | |
run: mv out/html/black-book.html out/html/index.html | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: out | |
ebooks: | |
runs-on: ubuntu-latest | |
name: ebooks | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Make output | |
run: mkdir -p out | |
- name: cat files | |
id: files | |
run: | | |
FILES=$(cat filelist.txt) | |
echo "::set-output name=input_files::$FILES" | |
- name: pandoc epub | |
uses: docker://pandoc/core:2 | |
with: | |
entrypoint: /usr/local/bin/pandoc | |
args: '--to epub3+smart -o out/black-book.epub --epub-cover-image images/cover.png --toc --epub-chapter-level=2 --data-dir=epub --template=epub/template.html ${{ steps.files.outputs.input_files }}' | |
- name: kindlegen | |
uses: docker://jagregory/kindlegen | |
with: | |
args: kindlegen out/black-book.epub -verbose | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: out | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [html, ebooks] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
path: out | |
- name: zip html | |
run: tar -czf ../html.tar.gz . | |
working-directory: out/artifact/html | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
prerelease: false | |
name: ${{ needs.check-version.outputs.version }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
out/artifact/black-book.epub | |
out/artifact/black-book.mobi | |
out/artifact/html.tar.gz | |
- name: Deploy GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: out/artifact/html |