-
Notifications
You must be signed in to change notification settings - Fork 111
68 lines (56 loc) · 1.84 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Book Deploy
on:
release:
types: [created]
push:
# all
workflow_dispatch:
jobs:
docker-build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-buildx-${{ hashFiles('poetry.lock') }}
# This build and push step does the same thing as `make docker-build`, but
# makes it easier to store and load caches, which is why we use it instead
- name: Build and Save Layers Locally
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: python4compscience
- name: List Available Images
run: docker images
- name: Make Docker HTML
run: make docker-html
- name: Check links - Markdown
uses: gaurav-nelson/github-action-markdown-link-check@v1
- name: Make Docker Linkcheck
run: make docker-linkcheck
- name: Make Docker PDF
run: |
make docker-pdf
sudo cp book/_build/latex/book.pdf book/_build/html/book.pdf
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_build/html
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Development Build"
files: book/_build/latex/book.pdf