Skip to content

Commit

Permalink
Adding GitHub Workflow instead of TravisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Oct 16, 2019
1 parent d3013a8 commit 0c6ab0b
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 76 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/vuepress-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: "vuepress-build"

on:
push:
branches: [master]
paths:
- '.github/**'
- 'docs/**'
- .spelling
- package.json
- package-lock.json

env:
EXCLUDE_WEB_PAGES: "(mylabs.dev)"

jobs:
markdown-lint-check:
name: "Markdown lint check"
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1

- name: "Install Node.js 12"
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: "Install markdownlint-cli"
run: npm install -g markdownlint-cli

- name: "Create markdownlint configuration file"
run: |
echo "{ MD013: { code_blocks: false } }" > /tmp/markdownlint_config.json
- name: "Run markdownlint"
run: find . -path ./node_modules -prune -o -name "*.md" -print0 | xargs -t -0 markdownlint -c /tmp/markdownlint_config.json

markdown-spell-check:
name: "Markdown spell check"
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1

- name: "Install Node.js 12"
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: "Install markdown-spellcheck"
run: npm install -g markdown-spellcheck

- name: "Run mdspell"
run: mdspell '**/*.md' '!**/node_modules/**/*.md' --ignore-numbers --ignore-acronyms --report --en-gb

vuepress-build:
name: "VuePress build"
runs-on: ubuntu-18.04
needs:
- markdown-lint-check
- markdown-spell-check

steps:
- uses: actions/checkout@v1

- name: "Install Node.js 12"
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: "Install VuePress and build the document"
run: |
npm install
npm run build
cp LICENSE docs/.vuepress/dist
ln -s docs/.vuepress/dist ${GITHUB_REPOSITORY##*/}
sed -e "s@(part-@(https://github.com/${GITHUB_REPOSITORY}/tree/master/docs/part-@" -e 's@.\/.vuepress\/public\/@./@' docs/README.md > docs/.vuepress/dist/README.md
touch docs/.vuepress/dist/.nojekyll
- name: "Check links"
run: |
echo "127.0.0.1 ${GITHUB_REPOSITORY%/*}.github.io" | sudo tee -a /etc/hosts
curl -s https://getcaddy.com | bash -s personal
cat > Caddyfile << EOF
https://${GITHUB_REPOSITORY%/*}.github.io
tls self_signed
EOF
sudo caddy -quiet &
go get -u github.com/raviqqe/muffet
~/go/bin/muffet --skip-tls-verification --exclude "${EXCLUDE_WEB_PAGES}" https://${GITHUB_REPOSITORY%/*}.github.io/${GITHUB_REPOSITORY##*/}
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./docs/.vuepress/dist
75 changes: 0 additions & 75 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kubernetes + Knative + GitLab + Harbor

[![Build Status](https://travis-ci.com/ruzickap/k8s-knative-gitlab-harbor.svg?branch=master)](https://travis-ci.com/ruzickap/k8s-knative-gitlab-harbor)
[![Build Status](https://github.com/ruzickap/k8s-knative-gitlab-harbor/workflows/vuepress-build/badge.svg)](https://github.com/ruzickap/k8s-knative-gitlab-harbor/actions?workflow=vuepress-build)

* Demo GitHub repository: [https://github.com/ruzickap/k8s-knative-gitlab-harbor](https://github.com/ruzickap/k8s-knative-gitlab-harbor)
* Demo Web Pages: [https://ruzickap.github.io/k8s-knative-gitlab-harbor](https://ruzickap.github.io/k8s-knative-gitlab-harbor)
Expand Down

0 comments on commit 0c6ab0b

Please sign in to comment.