Skip to content

adding section on camera flashes #59

adding section on camera flashes

adding section on camera flashes #59

name: Build and Deploy
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
paths:
- 'blog-contents/**'
- 'projects/**'
- 'html-parts/**'
- 'other-pages/**'
- 'styles/**'
- 'wiki/**'
- 'build.sh'
- 'pandoc-options.yaml'
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# build the website
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# first install pandoc from dpkg
- name: Install Pandoc
run: |
# because ubuntu is dumb and doesn't backport important software
sudo apt purge pandoc
wget -q https://github.com/jgm/pandoc/releases/download/2.13/pandoc-2.13-1-amd64.deb
sudo apt install ./pandoc-2.13-1-amd64.deb
# remove deb file to not polute repo
rm pandoc-2.13-1-amd64.deb
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: build
run: |
pandoc --version
./build.sh
# may want to add caching here if the external link testing takes
# too long
#- name: Lint generated HTML and CSS
# uses: chabad360/htmlproofer@v1.1
# with:
# directory: "./www"
# # hash-href links to top of page
# arguments: >-
# --allow-hash-href
# --check-favicon
# --check-html
# --check-img-http
# --enforce-https
# --error-sort=path
# --report-invalid-tags
# --report-missing-names
# --report-missing-doctype
# --report-eof-tags
# --report-mismatched-tags
- name: HTML5 validation
uses: Cyb3r-Jak3/html5validator-action@v0.6
with:
css: true
root: www/
#- name: upload validation logs
# uses: actions/upload-artifact@v2
# with:
# name: validation-log
# path: log.log
- name: deploy
run: |
git config --global user.email "gh-actions@sww1235.net"
git config --global user.name "Robots"
# after cd, will be in $HOME
cd ..
git clone https://${{secrets.GHA_DEPLOY}}@github.com/sww1235/sww1235.github.io.git website
# overwrite www directory contents of ghpages repo with new files
cp -rf Personal_Website/www/. website/
# cd into ghpages repo
cd website
# check if there were differences between existing website and newly built files.
# allows build to succeed if the actual website pages didn't change at all.
if ! git diff-index --quiet HEAD --; then
# add files to gh pages repo and commit
git add -A
# commit files to gh pages
git commit -m "Website as of $(date -Iseconds -u )"
git push
fi