-
Notifications
You must be signed in to change notification settings - Fork 18
executable file
·88 lines (80 loc) · 2.59 KB
/
quarto-book-fedora.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
on:
push:
branches: main
pull_request:
branches: main
# to be able to trigger a manual build
workflow_dispatch:
schedule:
# 每周四 早上 7 点
- cron: '0 23 * * 3'
name: Book-Fedora
env:
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
RUST_BACKTRACE: 1
jobs:
build-deploy:
if: "!contains(github.event.head_commit.message, '[docker]')"
runs-on: ubuntu-22.04
env:
CMDSTAN_VERSION: "2.33.1"
container:
image: ghcr.io/xiangyunhuang/fedora-rstudio-pro:1.4.395
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- ${{ github.workspace }}:/home/docker
ports:
- 8383:8787
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Render Book (all)
if: github.event_name == 'push'
run: |
quarto render --to html
shell: bash
env:
RETICULATE_PYTHON_ENV: /opt/.virtualenvs/r-tensorflow
RETICULATE_PYTHON: /opt/.virtualenvs/r-tensorflow/bin/python
CMDSTAN: /opt/cmdstan/cmdstan-${{ env.CMDSTAN_VERSION }}
- name: Render Book (html)
if: github.event_name != 'push'
run: |
quarto render --to html
shell: bash
env:
RETICULATE_PYTHON_ENV: /opt/.virtualenvs/r-tensorflow
RETICULATE_PYTHON: /opt/.virtualenvs/r-tensorflow/bin/python
CMDSTAN: /opt/cmdstan/cmdstan-${{ env.CMDSTAN_VERSION }}
- name: Deploy to Netlify
if: contains(env.isExtPR, 'false')
id: netlify-deploy
uses: nwtgck/actions-netlify@v2
with:
publish-dir: './_book'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
enable-pull-request-comment: true
enable-commit-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 10
- name: Deploy book to bookdown.org
if: github.event_name == 'push'
env:
CONNECT_API_KEY: ${{ secrets.RSC_BOOKDOWN_TOKEN }}
CONTENT_ID: ${{ secrets.RSC_BOOKDOWN_APP_ID }}
run: |
Rscript '_deploy.R'
shell: bash
- name: Upload book folder for debug
if: failure()
uses: actions/upload-artifact@v3
with:
name: Upload Book
path: _book