generated from DanySK/Template-Hugo-Reveal-Slides
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.58 KB
/
build-and-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
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build and deploy
on:
push:
tags: '*'
branches-ignore:
- 'autodelivery**'
- 'bump-**'
- 'renovate/**'
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
- '.github/workflows/update-hugo.yml'
pull_request:
workflow_dispatch:
permissions: {}
jobs:
Build-Slides:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Checkout the repository
- name: Checkout
uses: danysk/action-checkout@0.2.12
- name: Compute the version of Hugo
id: hugo
shell: bash
run: |
# Idea: the regex matcher of Renovate keeps this string up to date automatically
# The version is extracted and used to access the correct version of the scripts
USES=$(cat <<TRICK_RENOVATE
- uses: gohugoio/hugo@v0.118.2
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@v}\""
echo "version=${USES#*@v}" >> $GITHUB_OUTPUT
- name: Download Hugo
run: |
HUGO_VERSION="${{ steps.hugo.outputs.version }}"
URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
wget --retry-connrefused --waitretry=1 --read-timeout=20 "$URL" --output-document=hugo.deb
- name: List files
run: ls -ahl
- name: Install Hugo
run: sudo dpkg -i hugo.deb
- name: Print Hugo version
run: hugo version
- name: Remove Hugo Installer
run: rm hugo.deb
# - name: Start SSH session
# uses: luchihoratiu/debug-via-ssh@main
# with:
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
# SSH_PASS: ${{ secrets.SSH_PASS }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1.152.0
with:
working-directory: shared-slides
- name: Run the preprocessor
run: shared-slides/preprocess.rb
- name: Build slides with hugo
run: hugo
- name: Transform and Inline Mermaid charts
uses: cric96/inline-mermaid@v1.8.1
with:
css-file-regex: '^css\\/.*custom.*theme.*\\.css$'
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: Deploy website
if: ${{ github.event_name != 'pull_request' && steps.branch-name.outputs.is_default == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4.6.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build