Files
jarvis-at-skic 72831b268e
Validate and publish Pages / pages (push) Successful in 7s
feat: add KIZ3 digital reunion and restore natural photos
2026-08-17 18:28:23 +00:00

67 lines
2.2 KiB
YAML

name: Validate and publish Pages
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pages:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Validate static site
shell: bash
run: |
set -euo pipefail
test -s index.html
test -s styles.css
test -s script.js
test -s assets/donatas-gitara.jpg
test -s assets/donatas-scena.jpg
! test -e assets/donatas-hero.jpg
! test -e assets/donatas-anime-gitara.webp
! test -e assets/donatas-anime-scena.webp
grep -Fq 'donatas-gitara.jpg' index.html
grep -Fq 'donatas-scena.jpg' index.html
grep -Fq -- '--blue:#72d7ff' styles.css
grep -Fq 'GIMTADIENIS PRAĖJO' index.html
grep -Fq 'BISAS — NE' index.html
grep -Fq 'pilną širdį' index.html
grep -Fq 'Donatas Šimkus (Dūmas)' README.md
grep -Fq 'NE TIKRA CITATA' index.html
grep -Fq 'PASAULIS JUDA' index.html
grep -Fq 'twinButton' script.js
! grep -Fqi 'šiandien' index.html
grep -Fq 'vedejasdumas.lt' index.html
grep -Fq 'border-radius:0!important' styles.css
- name: Prepare build
shell: bash
run: |
set -euo pipefail
rm -rf build
mkdir -p build/assets
cp index.html styles.css script.js build/
cp assets/*.jpg build/assets/
test -f build/index.html
- name: Publish to LEGO Cloud Pages
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
shell: bash
run: |
set -euo pipefail
ORG_REPO='${{ gitea.repository }}'
case "$ORG_REPO" in */*) ;; *) exit 1 ;; esac
case "$ORG_REPO" in *..*|/*|*/|*//* ) exit 1 ;; esac
test -f build/index.html
pages_root='/gondor-v1-gitea-pages'
mountpoint -q "$pages_root" || { echo "$pages_root is not a persistent mount" >&2; exit 1; }
destination="$pages_root/$ORG_REPO"
rm -rf -- "$destination"
mkdir -p "$destination"
cp -a build/. "$destination/"