github.com/tych0/umoci@v0.4.2/hack/publish-site.sh (about)

     1  #!/bin/bash
     2  # Copyright (C) 2017, 2018 SUSE LLC.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #   http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  set -e
    17  
    18  
    19  # Change to site root.
    20  site_root="$(readlink -f "$(dirname "${BASH_SOURCE}")/../.site")"
    21  cd "$site_root"
    22  
    23  # Copy key files from the source directory to the right place.
    24  # These are ignored by git.
    25  cp ../CHANGELOG.md content/changelog.md
    26  cp ../CONTRIBUTING.md content/contributing.md
    27  cp ../contrib/logo/umoci-{white,black}.png static/
    28  
    29  # Check out the 'gh-pages' worktree.
    30  rm -rf public/ && git worktree prune
    31  git fetch -f https://github.com/openSUSE/umoci.git gh-pages:gh-pages
    32  git worktree add -B gh-pages 'public' gh-pages
    33  
    34  # Build the source.
    35  hugo
    36  
    37  # Commit the changes.
    38  (
    39  	cd public/ ;
    40  	git add --all ;
    41  	git commit -sm "update gh-pages $(date --utc --iso-8601=s)" ;
    42  )