Skip to content

Update from https://github.com/opengisch/teaching-and-talks/commit/87… #213

Update from https://github.com/opengisch/teaching-and-talks/commit/87…

Update from https://github.com/opengisch/teaching-and-talks/commit/87… #213

Workflow file for this run

name: Staging
on:
push:
branches:
- staging
pull_request:
branches:
- staging
env:
BUILD: ./build
INDEX: ./build/index.html
jobs:
update_index_push_to_prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Check for './build' and './build/index.html'
# Flatten directories
# Cleanup
# Push to production
- name: 🧐 Check for build
run: |
# ------------
# Ensure files
# ------------
declare -a missing
if ! [[ -d "$BUILD" ]]; then
missing+=("build")
fi
if ! [[ -f "$INDEX" ]]; then
missing+=("build/index.html")
fi
if ! [[ ${#missing[*]} -eq 0 ]]
then
echo "::error ::Missing files from 'staging' branch."
echo "Missing: ${missing[*]}"
exit 1
else
exit 0
fi
- name: Unpack subfolders to improve page navigation
run: mv $BUILD/* .
- name: 🧹 Cleanup
run: rmdir $BUILD
- name: Create .nojekyll file to avoid problems with CSS
run: touch .nojekyll
- name: 🚠 Push to production
uses: EndBug/add-and-commit@v9
with:
message: Deploying build
add: '.'
push: origin HEAD:production --force