From 81ff7baeb2fde90d2c70abafe0f7a724301c43ce Mon Sep 17 00:00:00 2001 From: Petr Ruzicka Date: Thu, 17 Oct 2019 20:56:27 +0200 Subject: [PATCH] Adding GitHub Workflow instead of TravisCI --- .dependabot/config.yml | 3 -- .github/workflows/hugo-build.yml | 48 ++++++++++++++++++++++++++++++++ .travis.yml | 33 ---------------------- LICENSE | 21 ++++++++++++++ README.md | 2 +- 5 files changed, 70 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/hugo-build.yml delete mode 100644 .travis.yml create mode 100644 LICENSE diff --git a/.dependabot/config.yml b/.dependabot/config.yml index dfcb427..4578efa 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -5,6 +5,3 @@ update_configs: update_schedule: "daily" default_assignees: - "ruzickap" - default_labels: - - "dependencies" - - "submodules" diff --git a/.github/workflows/hugo-build.yml b/.github/workflows/hugo-build.yml new file mode 100644 index 0000000..bec39f0 --- /dev/null +++ b/.github/workflows/hugo-build.yml @@ -0,0 +1,48 @@ +name: "hugo-build" + +on: + push: + branches: [master] + +jobs: + hugo-build: + name: "Hugo build" + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2.2.2 + with: + hugo-version: '0.58.3' + + - name: Build + run: | + hugo --gc + cp LICENSE README.md public/ + echo ${GITHUB_REPOSITORY##*/} > public/CNAME + + - name: "Check links" + run: | + echo "127.0.0.1 ${GITHUB_REPOSITORY##*/}" | sudo tee -a /etc/hosts + curl -s https://getcaddy.com | bash -s personal + cat > Caddyfile << EOF + https://${GITHUB_REPOSITORY##*/} + root public + tls self_signed + EOF + sudo caddy -quiet & + go get -u github.com/raviqqe/muffet + ~/go/bin/muffet --skip-tls-verification --buffer-size=8192 --exclude "https://www.linkedin.com/in/petrruzicka/" https://${GITHUB_REPOSITORY##*/} + + - name: Deploy + uses: peaceiris/actions-gh-pages@v2.5.0 + env: + ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: public/ + with: + emptyCommits: false + forceOrphan: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 572c496..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -dist: xenial - -language: minimal - -branches: - only: - - master - -services: - - docker - -install: - - gem install awesome_bot - - export HUGO_LATEST_RELEASE=$(curl -s https://github.com/gohugoio/hugo/releases/latest | sed 's@.*releases/tag/v\([^"]*\).*@\1@') - - curl --silent --location https://github.com/gohugoio/hugo/releases/download/v${HUGO_LATEST_RELEASE}/hugo_${HUGO_LATEST_RELEASE}_Linux-64bit.tar.gz | sudo tar xvzf - -C /usr/local/bin/ hugo - - rm -rf public || exit 0 - -script: - - export HOST_IP_ADDRESS="$(ip -4 addr show docker0 | sed -n 's/.* inet \([^/]*\).*/\1/p')" - - hugo server --bind ${HOST_IP_ADDRESS} --baseURL http://${TRAVIS_REPO_SLUG##*/} & - - docker run -it --rm --add-host ${TRAVIS_REPO_SLUG##*/}:${HOST_IP_ADDRESS} linkchecker/linkchecker --check-extern http://${TRAVIS_REPO_SLUG##*/}:1313 - - awesome_bot --allow-dupe --allow-redirect --skip-save-results `find . -name *.md` - - hugo - -# Deploy to GitHub pages -deploy: - provider: pages - fqdn: ${TRAVIS_REPO_SLUG##*/} - skip_cleanup: true - github_token: $GITHUB_TOKEN - local_dir: public - on: - branch: master diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e74808a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Petr Ruzicka + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 695773a..c51f463 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Personal web page -[![Build Status](https://travis-ci.com/ruzickap/petr.ruzicka.dev.svg?branch=master)](https://travis-ci.com/ruzickap/petr.ruzicka.dev) +![Build Status](https://github.com/ruzickap/petr.ruzicka.dev/workflows/hugo-build/badge.svg) ## Instalation