Skip to content

Commit

Permalink
ci: Build website and add it to GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed May 22, 2023
1 parent 35dd12b commit 61af84c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docs

on:
push:
branches:
- master

jobs:
website:
runs-on: ubuntu-latest

name: "Build website"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP with latest composer
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

- name: Build API docs
run: |
pushd docs/apigen
composer install
composer exec -- apigen
popd
- name: Build website
run: |
cd docs
wget -q -O - "https://github.com/getzola/zola/releases/download/v0.16.1/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz" | tar xzf -
./zola build
- name: Copy demo & SimplePie
run: |
cp -r autoloader.php idn/ src/ library/ demo/ docs/public/
grep --perl-regexp --only-matching --null-data "(?s)(.+)(?=<!DOCTYPE html>)" demo/index.php > docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(.+)(?=<!-- BODY START -->)" docs/public/demo/index.html >> docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(?<=<!-- BODY START -->)(.+)(?=<!-- BODY END -->)" demo/index.php >> docs/public/demo/index.php
grep --perl-regexp --only-matching --null-data "(?s)(?<=<!-- BODY END -->)(.+)" docs/public/demo/index.html >> docs/public/demo/index.php
rm docs/public/demo/index.html
- name: Upload to web server
uses: SamKirkland/FTP-Deploy-Action@4.3.3
with:
local-dir: docs/public/
server: ${{ vars.SFTP_SERVER }}
port: ${{ vars.SFTP_SERVER }}
protocol: ftps
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}
3 changes: 2 additions & 1 deletion demo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<div id="site">

<div id="content">

<!-- BODY START -->
<div class="chunk">
<form action="" method="get" name="sp_form" id="sp_form">
<div id="sp_input">
Expand Down Expand Up @@ -234,6 +234,7 @@
<?php endif; ?>

</div>
<!-- BODY END -->

<div>
<!-- Display how fast the page was rendered. -->
Expand Down

0 comments on commit 61af84c

Please sign in to comment.