Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Prepare codebase to migrate to GitHub Pages #127

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy to GitHub pages

on:
push:
branches: [ "master" ]
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "gh-pages"
cancel-in-progress: false

permissions: {}

jobs:
build:
name: Build site
runs-on: ubuntu-latest
if: github.repository_owner == 'silverstripe'
permissions:
contents: read
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

- name: Checkout code
uses: actions/checkout@v4

- name: Setup GH pages
id: pages
uses: actions/configure-pages@v5

- name: Build static files
shell: bash
run: |
composer install
./makedoc.sh

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "htdocs/"

deploy:
name: Deploy site
needs: build
runs-on: ubuntu-latest
if: github.repository_owner == 'silverstripe'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
59 changes: 0 additions & 59 deletions .htaccess

This file was deleted.

17 changes: 0 additions & 17 deletions .platform.yml

This file was deleted.

12 changes: 0 additions & 12 deletions browserconfig.xml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files referenced here don't exist

This file was deleted.

54 changes: 27 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions conf/doctum.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"4": "4.x",
"3": "3.x"
},
"default_version": "5",
"paths": {
"www": "htdocs",
"cache": "data/cache",
Expand Down
5 changes: 3 additions & 2 deletions conf/doctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
use Doctum\Project;
use Doctum\Doctum;
use SilverStripe\ApiDocs\Data\ApiJsonStore;
use SilverStripe\ApiDocs\Data\Config;
use SilverStripe\ApiDocs\Inspections\RecipeFinder;
use SilverStripe\ApiDocs\Inspections\RecipeVersionCollection;
use SilverStripe\ApiDocs\RemoteRepository\SilverStripeRemoteRepository;
use SilverStripe\ApiDocs\SilverstripeProject;

// Get config
$config = Config::getConfig();
Expand Down Expand Up @@ -70,7 +70,7 @@
// Override project
unset($doctum['project']);
$doctum['project'] = function ($sc) {
$project = new Project($sc['store'], $sc['_versions'], array(
$project = new SilverstripeProject($sc['store'], $sc['_versions'], array(
'build_dir' => $sc['build_dir'],
'cache_dir' => $sc['cache_dir'],
'remote_repository' => $sc['remote_repository'],
Expand All @@ -82,6 +82,7 @@
'source_dir' => $sc['source_dir'],
'insert_todos' => $sc['insert_todos'],
'base_url' => $sc['base_url'],
'favicon' => '/favicon.ico',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we not have this until now lol

'footer_link' => [
'href' => 'https://github.com/silverstripe/api.silverstripe.org',
'rel' => 'noreferrer noopener',
Expand Down
Loading
Loading