From 1a568afd456814d8d7081ff6c6fe05760862bb8a Mon Sep 17 00:00:00 2001 From: B Kleinen Date: Sat, 25 Sep 2021 12:08:04 +0200 Subject: [PATCH] setup deployment pipeline --- .drone.yml | 30 ++++++++++++++++- .github/workflows/deploy-production.yml | 24 ++++++++++++++ .../{gh-pages.yml => deploy-staging.yml} | 12 +++---- README.MD | 33 +++++++++---------- content/termine/termine.md | 2 +- makefile | 24 ++++++++++++-- 6 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/deploy-production.yml rename .github/workflows/{gh-pages.yml => deploy-staging.yml} (76%) diff --git a/.drone.yml b/.drone.yml index d03c2d2..e05c429 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,32 @@ kind: pipeline type: kubernetes -name: hugoweb +name: Hugo Only steps: + + - name: submodules + image: bitnami/git:latest + commands: + - git submodule update --init --recursive + + - name: hugo + image: plugins/hugo + settings: + validate: true + hugo_version: 0.88.1 + extended: true + +trigger: + branch: + - master + +--- +kind: pipeline +type: kubernetes +name: Deploy + +steps: + - name: submodules image: bitnami/git:latest commands: @@ -29,3 +53,7 @@ steps: secrets: [rsync_key] key: from_secret: rsync_key + +trigger: + ref: + - refs/tags/v* diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 0000000..144282f --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,24 @@ +name: Deploy Production +on: + push: + tags: + - 'v*' +#on: +# release: +# types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # needs to be complete for later push + ref: master + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: echo tag + run: echo "---- about to deploy tag ${RELEASE_VERSION}" + - name: Push to Production Repo + run: | + git push https://${{ secrets.P_USER }}:${{ secrets.P_PASSWD }}@${{ secrets.P_URL }} master ${RELEASE_VERSION} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/deploy-staging.yml similarity index 76% rename from .github/workflows/gh-pages.yml rename to .github/workflows/deploy-staging.yml index 07da141..9ac91a1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/deploy-staging.yml @@ -1,19 +1,19 @@ -name: github pages +name: Deploy Staging on: push: branches: - master # Set a branch to deploy - pull_request: + tags-ignore: + - 'v*' jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo uses: peaceiris/actions-hugo@v2 @@ -21,10 +21,10 @@ jobs: hugo-version: 'latest' extended: true - - name: Build + - name: Build Hugo Site run: hugo --minify -e staging - - name: Deploy + - name: Deploy to Staging on Github Pages uses: peaceiris/actions-gh-pages@v3 if: github.ref == 'refs/heads/master' with: diff --git a/README.MD b/README.MD index 68c70f9..7da268d 100644 --- a/README.MD +++ b/README.MD @@ -1,5 +1,7 @@ # About the SEUH 2022 Website +This is the source code for the [SEUH 2022 Website.](https://seuh.org/seuh2022/) + This website was built with the static site generator [Hugo](https://gohugo.io/). ## Development: @@ -14,19 +16,8 @@ cd and start the server with: And then view the generated site here: http://localhost:1313/seuh2022 -One liner for start & open: - - open http://localhost:1313/seuh2022 ; hugo -D -p 1313 server - -## Theme - -The SEUH 2022 Website is based on the -[Hero Hugo Theme](https://themes.gohugo.io/themes/hugo-hero-theme/), on GitHub: -[zerostaticthemes/hugo-hero-theme: A multi-page Hugo theme with fullscreen hero images and fullwidth sections.](https://github.com/zerostaticthemes/hugo-hero-theme) +Have a look at the makefile for useful commands. -Based on a fork in [seuh2022/hugo-hero-theme](https://github.com/seuh2022/hugo-hero-theme), after -reading this article: -[Using git submodule for Hugo themes - Don't Panic](https://www.andrewhoog.com/post/git-submodule-for-hugo-themes/) ## Structure @@ -35,15 +26,23 @@ reading this article: | - About + Sponsoren | - Programm | - CFP | - Maillingliste | | - Geschichte | - Tagungsband | - Registration | - Local Orga | +## Deployment Pipeline + +- [Staging Environment](https://seuh2022.github.io/seuh2022-website) + ## Credits +### Icons The free icons are from B[ootstrap-Icons](https://icons.getbootstrap.com/). -The Berlin fotos are from +### Theme + +The SEUH 2022 Website is based on the + +[Hero Hugo Theme](https://themes.gohugo.io/themes/hugo-hero-theme/), on GitHub: +[zerostaticthemes/hugo-hero-theme: A multi-page Hugo theme with fullscreen hero images and fullwidth sections.](https://github.com/zerostaticthemes/hugo-hero-theme) -Photo by Adam Vradenburg on Unsplash - and -Photo by Piero Nigro on Unsplash +### Photos -The HTW Beach Bar Photo is by Nikolas Fahlbusch. +see the[ Photo credits site](https://www.seuh.org/seuh2022/about/). diff --git a/content/termine/termine.md b/content/termine/termine.md index 97a3fc8..5f26715 100644 --- a/content/termine/termine.md +++ b/content/termine/termine.md @@ -13,4 +13,4 @@ icon: "icons/calendar3.svg" | 15. Oktober 2021 |    | Einreichung von Beiträgen | | 1. Dezember 2021 | | Nachricht über die Annahme | | 31. Dezember 2021 | | Einreichung der Endbeiträge | -| 24./25. Februar 2022 | | SEUH | +| 24./25. Februar 2022 | | SEUH 2022 | diff --git a/makefile b/makefile index ac675b9..99c041f 100644 --- a/makefile +++ b/makefile @@ -1,13 +1,13 @@ push: git submodule foreach --recursive 'git push' - git push + git push origin master hugo: open http://localhost:1313/seuh2022 hugo -D -p 1313 server -github: +staging: open http://localhost:1414/seuh2022-website hugo --baseURL=http://localhost:1414/seuh2022-website/ -p 1414 -e staging server -stuttgart: +production: open http://localhost:1515/seuh2022/ hugo --baseURL=http://localhost:1515/seuh2022/ -p 1515 -e production server build_production: @@ -18,3 +18,21 @@ update_theme: git submodule update --init --recursive deploy: git push production master +pages: + open https://webgit.k8s.sqa.ddnss.org/snowball/hugo-test + open https://drone.k8s.sqa.ddnss.org/snowball/hugo-test/ + open https://github.com/seuh2022/seuh2022-website + open https://seuh.org/seuh2022 +# make check f=gh-tag.yml +check: + ruby -ryaml -e "puts YAML.load(STDIN.read).inspect" < .github/workflows/$(f) +actions: + open https://github.com/seuh2022/seuh2022-website/actions +# make tag t="t5" +tag: + echo "create and push tag $(t)" + git tag $(t) + git submodule foreach --recursive 'git push' + git push origin master $(t) + #git push origin $(t) + open https://github.com/seuh2022/seuh2022-website/actions