-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (69 loc) · 2.41 KB
/
main.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
name: Zola on GitHub Pages
on:
push:
branches:
- main
env:
LATEST_VERSION: 3.0.18
jobs:
build:
name: Publish site
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version name
env:
GH_TOKEN: ${{ github.token }}
run: |
sed -i "s#v0\.19\.2#${{ env.LATEST_VERSION }}#g" content/_index.md
export GITHUB_PAGES_URL=$(gh api "repos/${{ github.repository }}/pages" --jq '.html_url')
sed -i "s#https:\/\/libical\.github\.io#${GITHUB_PAGES_URL}#g" config.toml
export GITHUB_CODE_WEBSITE="${{ github.server_url }}/${{ github.repository }}"
sed -i "s#https:\/\/github.com\/libical\/io.github.libical#${GITHUB_CODE_WEBSITE}#g" config.toml
- name: Build website
uses: shalzz/[email protected]
env:
BUILD_ONLY: true
- name: Checkout libical v${{ env.LATEST_VERSION }}
uses: actions/checkout@v4
with:
repository: libical/libical
ref: v${{ env.LATEST_VERSION }}
path: libical-sources
- name: Install dependencies
run: sudo apt-get -y install gtk-doc-tools xml-core libdb-dev gobject-introspection libgirepository1.0-dev cmake ninja-build doxygen graphviz
- name: Configure libical
run: |
cd libical-sources
mkdir build
cmake -B build -G Ninja -DENABLE_GTK_DOC=True -DICAL_GLIB=True -DGOBJECT_INTROSPECTION=True -DICAL_BUILD_DOCS=True
- name: Build libical documentation
run: |
cd libical-sources
cmake --build build --target docs
- name: Move Documentation
run: |
sudo rm -R public/docs/developer/libical
sudo mv libical-sources/build/apidocs/html public/docs/developer/libical
sudo rm -R public/docs/developer/libical-glib
sudo mv public/libical-glib public/docs/developer/libical-glib
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
# upload entire directory
path: 'public'
deploy:
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy artifact
id: deployment
uses: actions/deploy-pages@v4