-
Notifications
You must be signed in to change notification settings - Fork 30
86 lines (72 loc) · 2.47 KB
/
merge.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
82
83
84
85
86
name: Merge actions
on:
push:
branches:
- master
jobs:
build_docs:
name: "Build documentation tarball"
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
# BuildStream requires tags to be able to find its version.
with:
fetch-depth: 0
- name: Give `testuser` ownership of the source directory
run: sudo chown -R 1000:1000 ${GITHUB_WORKSPACE}
- name: Build documentation using Docker Compose
run: |
docker compose \
--env-file ${GITHUB_WORKSPACE}/.github/common.env \
--file ${GITHUB_WORKSPACE}/.github/compose/ci.docker-compose.yml \
run \
docs
# Restore permissions to the current user
sudo chown -R ${USER} ${GITHUB_WORKSPACE}
# Include a tarball in the published docs, allowing for
# easy re-publishing of master docs on docs.buildstream.build
tar -C doc/build/html -zcf docs.tgz .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: |
doc/build/html
docs.tgz
publish_docs:
needs: build_docs
runs-on: ubuntu-22.04
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Checkout code
uses: actions/checkout@v2
with:
ref: gh-pages
path: pages
fetch-depth: 0
- name: Update repo
run: |
# First reset the branch state to the initial commit, this ensures that
# we do not pollute the repository with the history of every docs package
# we've ever published (history of docs packages for major releases is
# also stored as GitHub release assets)
#
cd pages/
git reset --hard GH_PAGES_FIRST_COMMIT
# Copy the docs asset over and overwrite the orphan gh-pages branch, ensure
# that we disable GitHub's jekyll by creating the .nojekyll file, otherwise
# it will interfere with the rendering of the site.
#
cp -a ../docs/doc/build/html/* .
cp -a ../docs/docs.tgz .
touch .nojekyll
git add .
git config --local user.email "merge-ci@ponyland"
git config --local user.name "Github Actions Nightly Job"
git commit -m "Update repo for docs build $GITHUB_RUN_NUMBER"
git push --force "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" gh-pages