generated from kaakaa/slidev-resources-template
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 1.95 KB
/
release.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
name: Release slidev
on:
push:
branches-ignore:
- "*"
tags:
- "*"
concurrency: release-slidev
jobs:
release:
permissions:
contents: write
pages: read
runs-on: ubuntu-latest
steps:
- name: Install Japanese font # Insert these 2 lines
run: sudo apt install -y fonts-noto # to install Japanese font
- name: Setup Pages
id: configure-pages
uses: actions/configure-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- name: Export slidev as PDF
run: npm run export --slide=${GITHUB_REF##*/} && npm run export:dark --slide=${GITHUB_REF##*/}
- uses: softprops/action-gh-release@v2
with:
files: |
dist/*.pdf
- name: Check if OGP is enabled
id: checkOGP
uses: ./.github/actions/checkOGP
with:
file: ${GITHUB_REF##*/}/slides.md
- name: Generate index.html before building SPA
if: ${{ steps.checkOGP.outputs.ogp == 'true' }}
run: |
npm run build:before --slide=${GITHUB_REF##*/} --pagesurl=${{ steps.configure-pages.outputs.base_url }}
- name: Build slidev as SPA
run: npm run build --slide=${GITHUB_REF##*/}
- name: Generate preview image for OGP
if: ${{ steps.checkOGP.outputs.ogp == 'true' }}
run: |
npm run build:after --slide=${GITHUB_REF##*/}
- name: Deploy pages
uses: crazy-max/ghaction-github-pages@v4
with:
keep_history: true
build_dir: docs
verbose: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update:
needs: release
permissions:
contents: write
uses: ./.github/workflows/update-index-page.yaml
secrets: inherit