-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 260-named-anchor-fixes
- Loading branch information
Showing
12 changed files
with
128 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# This script is used in Github Actions to do link checking on commits to branches and master, so | ||
# please edit with care! See ../workflows/ci.yml for specific usage. | ||
# | ||
# If you're doing local development and want to run link checkers locally, please use this script! | ||
# You'll need: | ||
# - install go - https://golang.org/doc/install | ||
# - install muffet - https://github.com/raviqqe/muffet | ||
# - make sure muffet is in your PATH | ||
# - run from root of this repo: ./.github/scripts/muffet.sh | ||
# | ||
# If we have errors from this script being too aggressive (see how large downloads on | ||
# download.docker.com are excluded below) you can add additional sites as needed. Please | ||
# use extremely granular URLs so as not to exclude more than we need to. | ||
|
||
muffet http://localhost:1313 \ | ||
--buffer-size 50000 \ | ||
--timeout 35 \ | ||
--concurrency 2 \ | ||
--ignore-fragments \ | ||
--exclude ".*demo\.app\.medicmobile\.org.*" \ | ||
--exclude ".*download\.docker\.com.*" \ | ||
--exclude ".*www\.npmjs\.com/org/medic/team/developers" \ | ||
--exclude "https://github\.com/medic/cht-docs/issues/new.*" \ | ||
--exclude "https://github\.com/medic/cht-core/issues/new.*" \ | ||
--exclude "https://github\.com/medic/cht-docs/commit.*" \ | ||
--exclude "https://github\.com/medic/cht-core/commit.*" \ | ||
--exclude "https://github\.com/medic/cht-docs/edit/master/.*" \ | ||
--exclude ".*localhost:5984.*" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,72 @@ | ||
name: CHT Documentation Site Build | ||
# Notes: | ||
# - All software installed below is pinned so they don't get upgraded and break w/o us knowing why. | ||
# - If you bump one version up to latest, please bump them all so we stay current! | ||
# - Hugo builds the site twice: once for link checking and once minified for pushing live | ||
# - Bash script for muffet is intentionally stand alone so devs/content editors can easily run it locally | ||
|
||
on: | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- '*' # branch checking is below so all this is one CI file | ||
|
||
name: Test site and push live if we're on Master | ||
jobs: | ||
build: | ||
|
||
BuildLinkCheckPushLive: | ||
name: | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- name: Git checkout | ||
|
||
- name: All Branches - Git checkout, including recursive call for Docsy theme | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive # Fetch the Docsy theme | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
|
||
- name: Install Node depencies | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- run: npm install | ||
- run: npm install -g postcss-cli | ||
- run: npm i -D autoprefixer | ||
|
||
- name: Setup hugo | ||
- name: All Branches - Install hugo extended v0.71.1 | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: "0.71.1" | ||
extended: true | ||
|
||
- name: Build | ||
# Pinning to current version as of Aug 3, 2020 for stability | ||
- name: All Branches - Install Go v1.14 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.14' | ||
|
||
# Pinning to current version as of Aug 3, 2020 for stability | ||
- name: All Branches - Install Muffet v1.3.3 | ||
run: env GO111MODULE="on" go get github.com/raviqqe/[email protected] | ||
|
||
# run in background so CI doesn't hang waiting for "ctrl + c". Sleep so hugo server is ready | ||
- name: All Branches - Serve Hugo site | ||
run: | | ||
hugo server& | ||
sleep 5 | ||
- name: All Branches - Run Muffet link checker | ||
shell: bash | ||
run: ./.github/scripts/muffet.sh | ||
|
||
- name: Master Branch Only - Install Node 12.x | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Master Branch Only - Install npm modules for hugo build | ||
if: ${{github.ref == 'refs/heads/master' }} | ||
run: | | ||
npm install | ||
npm install -g postcss-cli | ||
npm i -D autoprefixer | ||
- name: Master Branch Only - Build for prod with minify | ||
if: github.ref == 'refs/heads/master' | ||
run: env HUGO_ENV="production" hugo --minify | ||
|
||
- name: Deploy | ||
- name: Master Branch Only - Deploy to GH pages | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
personal_token: ${{ secrets.DEPOLY_TO_SITE}} | ||
|
@@ -44,16 +76,14 @@ jobs: | |
user_email: medic-ci@github | ||
publish_branch: master | ||
|
||
- name: Failed Deploy | ||
- name: Master Branch Only - Report errors to Slack, if any | ||
if: ${{ github.ref == 'refs/heads/master' && failure() }} | ||
uses: rtCamp/[email protected] | ||
if: ${{ failure() }} | ||
env: | ||
SLACK_WEBHOOK: '${{ secrets.SLACK_WEB_HOOK }}' | ||
SLACK_CHANNEL: '#cht-squad-docs' | ||
SLACK_COLOR: '#3278BD' | ||
SLACK_ICON: ":flappingphone:" | ||
SLACK_MESSAGE: 'Deploy Failed' | ||
SLACK_TITLE: CHT DOCS DEPLOY | ||
SLACK_USERNAME: Medic-Bot | ||
|
||
|
||
SLACK_TITLE: CHT DOCS DEPLOY | ||
SLACK_USERNAME: Medic-Bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ node_modules/ | |
tech-doc-hugo | ||
|
||
.DS_Store | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.