Skip to content

Instantly share code, notes, and snippets.

@thedavecarroll
Last active September 9, 2022 05:29
Show Gist options
  • Save thedavecarroll/3e4a46d18653387cfa4d71c46a201f2d to your computer and use it in GitHub Desktop.
Save thedavecarroll/3e4a46d18653387cfa4d71c46a201f2d to your computer and use it in GitHub Desktop.
Recent Changes to the Site - thedavecarroll.com
#!/usr/bin/env bash
set -e # halt script on error
echo
echo "------------------------------------------------------------------------------------------------------------------------"
echo
if [ "$TRAVIS_PULL_REQUEST" != "false" -a "$TRAVIS_BRANCH" == "comments" ]; then
echo "Building site for pull request for $TRAVIS_BRANCH..."
echo
bundle exec jekyll build --config _config.yml --source . --destination ./docs
echo "Site built into /docs"
elif [ "$TRAVIS_BRANCH" == "main" ]; then
echo "Building site for $TRAVIS_BRANCH..."
echo
bundle exec jekyll build --config _config.yml --source . --destination ./docs
echo "Site built into /docs"
else
echo "Build not triggered internally"
echo
echo "------------------------------------------------------------------------------------------------------------------------"
exit 0
fi
echo
echo "------------------------------------------------------------------------------------------------------------------------"
echo
echo "Proofing links"
bundle exec htmlproofer ./docs --disable-external --allow_hash_href
echo "Proofing links complete"
echo
echo "------------------------------------------------------------------------------------------------------------------------"
exit 0
analytics:
provider : google-gtag
google:
tracking_id : G-PM1EP6J9FE
anonymize_ip : false
comments:
provider: "giscus"
giscus:
repo_id : "R_kgDOGcQm8w"
category_name : "Site Comments"
category_id : "DIC_kwDOGcQm884CRFma"
discussion_term : "pathname"
reactions_enabled : "1"
theme : "preferred_color_scheme"
comments:
provider : "staticman_v2"
staticman:
branch : "comments"
endpoint : "https://thedavecarroll.herokuapp.com/v2/entry/"
reCaptcha:
siteKey : "afortylengthcharacterstringforthesitekey"
secret : "areallyhugeencryptedstringthatisreturnedbythestaticmanapiencryptendpoint="
version: '3'
services:
jekyll:
environment:
- JEKYLL_ENV=docker
image: jekyll/jekyll:latest
container_name: thedavecarroll-com
command: >
bash -c "jekyll clean --destination ./docs
&& jekyll serve --force_polling --watch --port 4000 --config _config.yml,_config.docker.yml --destination ./docs --drafts --future --incremental"
ports:
- "4000:4000"
volumes:
- C:\\GitHub\\thedavecarroll.com:/srv/jekyll
- C:\\Docker\\Images\\jekyll\\bundle:/usr/local/bundle
{
"origins": [
"https://thedavecarroll.com"
],
"originsRegex": [
"http://localhost:[0-9]+"
]
}
name: Publish Dave's Technical Journal
on:
# Runs on push commits
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'publish')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
with:
generator_config_file: _config.yml
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
verbose: false
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
#!/usr/bin/env bash
echo
echo "------------------------------------------------------------------------------------------------------------------------"
echo "Sleeping 60 seconds"
sleep 60s
echo
echo "Pinging new sitemap"
echo "--------------------------------------------------------------------------------"
echo "Google"
wget -O- http://www.google.com/webmasters/tools/ping?sitemap=https%3A%2F%2Fpowershell.anovelidea.org%2Fsitemap.xml
echo "--------------------------------------------------------------------------------"
echo "Bing"
wget -O- http://www.bing.com/ping?siteMap=https%3A%2F%2Fpowershell.anovelidea.org%2Fsitemap.xml
echo
echo "------------------------------------------------------------------------------------------------------------------------"
comments:
# identification
name: "Dave's Technical Journal - Dave Carroll"
# general configuration
moderation: true
format: "yaml"
commitMessage: "New comment by {fields.name}"
requiredFields: ["name", "email", "message"]
transforms:
email: md5
generatedFields:
date:
type: "date"
options:
format: "iso8601"
# required properties
allowedFields: ["name", "email", "url","message"]
allowedOrigins: ["thedavecarroll.com"]
branch: "comments"
filename: "comment-{@timestamp}"
path: "_data/comments/{options.slug}"
# reCaptcha
reCaptcha:
enabled: true
siteKey: "afortylengthcharacterstringforthesitekey"
secret: "areallyhugeencryptedstringthatisreturnedbythestaticmanapiencryptendpoint="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment