-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.63 KB
/
publish-doc.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
name: Build and deploy
on:
push:
paths:
- 'docs/**'
- '.github/workflows/publish-doc.yaml'
pull_request:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
Build-Documentation-Site:
runs-on: ubuntu-latest
concurrency:
group: slides-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout
uses: danysk/action-checkout@0.2.14
- name: Compute the version of Hugo
id: hugo
shell: bash
run: |
USES=$(cat <<TRICK_RENOVATE
- uses: gohugoio/hugo@v0.123.0
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: Install Hugo
run: sudo dpkg -i hugo.deb
- name: Remove Hugo Installer
run: rm hugo.deb
- name: Build slides with hugo
run: |
cd docs
hugo
- name: Deploy website
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: docs
folder: docs/public