Skip to content

Commit 4dec7db

Browse files
xclaessejpakkane
authored andcommitted
ci: Automatically update website when pushing to master
1 parent 16c3f03 commit 4dec7db

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/website.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update website
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- docs/**
9+
workflow_dispatch:
10+
11+
jobs:
12+
update_website:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Install package
17+
run: |
18+
sudo apt-get -y install python3-pip ninja-build libjson-glib-dev
19+
pip install meson hotdoc
20+
- name: Setup SSH Keys and known_hosts
21+
env:
22+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
23+
run: |
24+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
25+
ssh-add - <<< "${{ secrets.WEBSITE_PRIV_KEY }}"
26+
- name: Update website
27+
env:
28+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
29+
run: |
30+
git config --global user.name "github-actions"
31+
git config --global user.email "github-actions@github.com"
32+
cd docs
33+
meson setup _build
34+
ninja -C _build
35+
ninja -C _build upload

docs/meson.build

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ documentation = hotdoc.generate_doc(meson.project_name(),
2727
include_paths: ['markdown', cur_bdir],
2828
default_license: 'CC-BY-SAv4.0',
2929
html_extra_theme: join_paths('theme', 'extra'),
30-
git_upload_repository: 'git@github.com:jpakkane/jpakkane.github.io.git',
30+
git_upload_repository: 'git@github.com:mesonbuild.github.io.git',
3131
edit_on_github_repository: 'https://github.com/mesonbuild/meson',
3232
syntax_highlighting_activate: true,
3333
)
3434

3535
run_target('upload',
36-
command: [find_program('hotdoc'), 'run', '--conf-file', documentation.config_path()]
36+
command: [find_program('hotdoc'), 'run',
37+
'--conf-file', documentation.config_path(),
38+
'--git-upload',
39+
'-vv',
40+
],
3741
)

0 commit comments

Comments
 (0)