Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
7c823789
Unverified
Commit
7c823789
authored
3 years ago
by
Richard van der Hoff
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
build the docs for master (#10323)
parent
c4524615
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/docs.yaml
+28
-31
28 additions, 31 deletions
.github/workflows/docs.yaml
with
28 additions
and
31 deletions
.github/workflows/docs.yaml
+
28
−
31
View file @
7c823789
...
...
@@ -7,6 +7,8 @@ on:
-
develop
# For documentation specific to a release
-
'
release-v*'
# stable docs
-
master
workflow_dispatch
:
...
...
@@ -25,40 +27,35 @@ jobs:
-
name
:
Build the documentation
run
:
mdbook build
# Deploy to the latest documentation directories
-
name
:
Deploy latest documentation
uses
:
peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
# v3.8.0
with
:
github_token
:
${{ secrets.GITHUB_TOKEN }}
keep_files
:
true
publish_dir
:
./book
destination_dir
:
./develop
-
name
:
Get the current Synapse version
# Figure out the target directory.
#
# The target directory depends on the name of the branch
#
-
name
:
Get the target directory name
id
:
vars
# The $GITHUB_REF value for a branch looks like `refs/heads/release-v1.2`. We do some
# shell magic to remove the "refs/heads/release-v" bit from this, to end up with "1.2",
# our major/minor version number, and set this to a var called `branch-version`.
#
# We then use some python to get Synapse's full version string, which may look
# like "1.2.3rc4". We set this to a var called `synapse-version`. We use this
# to determine if this release is still an RC, and if so block deployment.
run
:
|
echo ::set-output name=branch-version::${GITHUB_REF#refs/heads/release-v}
echo ::set-output name=synapse-version::`python3 -c 'import synapse; print(synapse.__version__)'`
# Deploy to the version-specific directory
-
name
:
Deploy release-specific documentation
# We only carry out this step if we're running on a release branch,
# and the current Synapse version does not have "rc" in the name.
#
# The result is that only full releases are deployed, but can be
# updated if the release branch gets retroactive fixes.
if
:
${{ startsWith( github.ref, 'refs/heads/release-v' ) && !contains( steps.vars.outputs.synapse-version, 'rc') }}
uses
:
peaceiris/actions-gh-pages@v3
# first strip the 'refs/heads/' prefix with some shell foo
branch="${GITHUB_REF#refs/heads/}"
case $branch in
release-*)
# strip 'release-' from the name for release branches.
branch="${branch#release-}"
;;
master)
# deploy to "latest" for the master branch.
branch="latest"
;;
esac
# finally, set the 'branch-version' var.
echo "::set-output name=branch-version::$branch"
# Deploy to the target directory.
-
name
:
Deploy to gh pages
uses
:
peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
# v3.8.0
with
:
github_token
:
${{ secrets.GITHUB_TOKEN }}
keep_files
:
true
publish_dir
:
./book
# The resulting documentation will end up in a directory named `vX.Y`.
destination_dir
:
./v${{ steps.vars.outputs.branch-version }}
destination_dir
:
./${{ steps.vars.outputs.branch-version }}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment