From 482a38af48e4ace2200273407a4cbdb252c2c978 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Sun, 2 Feb 2020 16:23:12 +0100 Subject: [PATCH] Update steps for publishing to mapstruct.org --- content/development/updating-mapstructorg.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/content/development/updating-mapstructorg.md b/content/development/updating-mapstructorg.md index 30264b07e..1a7566622 100644 --- a/content/development/updating-mapstructorg.md +++ b/content/development/updating-mapstructorg.md @@ -30,12 +30,6 @@ git clone git@github.com:mapstruct/mapstruct.org.git git remote rename origin upstream {{< /prettify >}} -Set up a tracking branch for the "gh-pages" branch: - -{{< prettify >}} -git fetch upstream && git branch --track gh-pages upstream/gh-pages -{{< /prettify >}} - ## Local preview Hugo comes with a built-in server for previewing the web site locally. Start it by running: @@ -78,11 +72,11 @@ The [team page](/development/team) is a data-driven page. If you want to be list ## Publishing to mapstruct.org -The web site is generated by running the `hugo` command. This generates the HTML pages in the _public_ directory. The contents of that directory then needs to be synchronized with the "upstream/gh-pages" branch. - -To make publication as smooth as possible, the script _scripts/publish.sh_ is taking care of the regeneration. It removes any existing contents from _public_, calls `hugo` and afterwards removes some generated files which are not needed. +The website is automatically published for every commit to master via [this GitHub Workflow](https://github.com/mapstruct/mapstruct.org/actions?query=workflow%3A%22GitHub+Pages%22). +The workflow generates the HTML with the `hugo` command in the _public_ directory. +The contents of that directory are then pushed to the "gh-pages" branch of the website repository. -For synchronizing _public_ with the local "gh-pages" branch the script creates a git worktree with the "gh-pages" branch in _public_ and commits the generated files into the "gh-pages" branch. You then only need to push that branch to upstream. +To make publication as smooth as possible, the script _scripts/generate-site.sh_ is taking care of the regeneration. It calls `hugo` and afterwards removes some generated files which are not needed. A typical editing process will look like this (assuming you start on the master directory): @@ -93,11 +87,9 @@ git merge upstream/master # do your changes... -# commit; then re-generate and update gh-pages +# commit git commit -a -m "Some website change" -./scripts/publish.sh # deploy -git push upstream gh-pages git push upstream master {{< /prettify >}}