From 87e93609a5535755fb40e05996ff997657aac6d2 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Fri, 5 Jul 2019 12:15:04 +0200 Subject: add automatic push of github pages add target in the makefile and the script used by it to get the website update .travis.yml to push the website on ghpages branch --- .travis.yml | 13 +++++++++++-- GNUmakefile | 2 ++ scripts/launch-website.sh | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 scripts/launch-website.sh diff --git a/.travis.yml b/.travis.yml index a20fc58..cc6e6c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,18 @@ script: - make vet - make website-test - make shellcheck +- make website-githubpages +deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + target_branch: gh-pages + keep_history: true + local_dir: terraform-provider-website + on: + all_branches: true + matrix: fast_finish: true allow_failures: @@ -33,5 +44,3 @@ cache: env: matrix: - GO111MODULE=on - global: - - secure: rWjnWJgGEk2ncl6TXnpahUmriGSEaHGy+ZfmKKGpvrZxnlNY6sy63+qrnJNwaiV6uRG+kPfEChYD+dYfhjZRb3JWivo/ILCM9E0M9Ike6YAAsJKrcl0rUwFgqhBVXRdpBCSieYGiY8xNH/4Wu6i4bD9F1vSmpkvxYwae+7vGvyhEhyGMqWU92Svlus//K0Y27Qvlcw+Mx35nhdZsaeKN1Tb7uCHed9+vpCHud9NpSJLqxBjQl+1ibJ0Fqefyqbqy5dO0X3xE70eUMwM70ew+sgwzyq45VDBRPtVAN+8mtLOp2BVZE7SXFydfqnAm+1cbgzYBE5t+HlXwZzpRrtSwj+NRUt+7UtlrdfhMRmUVW76qWyMbF8CY6i06a73XWMYffKg3Ux2h0AHimvPJl8y+luMYmrl0RdgyLDcR0t9La0PNhOrKsauzkNX7KGPZwjTWv3+2RrsXDdT0Pi3JL15myyEuxiSAdDLIyiFB0sz9mCzYiu02SKKyURfo3bhMUrrBRbF47CpLTiCJrNBI36rk/cO4QJXyd9axEhy7vXiQObvaWZKbBqMTsL9EOZijJt5I1UxjwbCGM/GyYSrDK/+7d7PF0bvjo+8ps/o2WIW5B63IZiadzIt6nUOlEpFoOUsn0x4mufzIzMd+CSXdTxdXqRIXHxf5pKAUQZ8u7uRwERY= diff --git a/GNUmakefile b/GNUmakefile index 7750632..fe6e28c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,6 +46,8 @@ test-compile: fi go test -c $(TEST) $(TESTARGS) +website-githubpages: + bash scripts/launch-website.sh website: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." diff --git a/scripts/launch-website.sh b/scripts/launch-website.sh new file mode 100755 index 0000000..f146e75 --- /dev/null +++ b/scripts/launch-website.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +(sleep 10; +wget --recursive --no-parent --domains localhost --page-requisites --html-extension --convert-links --no-clobber http://localhost:4567/docs/providers/mailgun/; + +rm -rf terraform-provider-website; +mv localhost:4567/ terraform-provider-website; + +docker stop "$(docker ps -q)") & + +make website -- cgit v1.2.3