Skip to content

Commit

Permalink
[Docs] - Add docs website. (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-carroll authored May 31, 2024
1 parent 42d7307 commit 5b36369
Show file tree
Hide file tree
Showing 39 changed files with 1,594 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and deploy documentation website
on:
push:
branches:
main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./doc/website
steps:
# Checkout the repository
- uses: actions/checkout@v3

# Setup a Dart environment
- uses: dart-lang/setup-dart@v1

# Download all the packages that the app uses
- run: dart pub get

# Build the static site
- run: dart run bin/flutter_test_robots_docs.dart
env:
GHUB_DOC_WEBSITE_TOKEN: ${{ vars.GHUB_DOC_WEBSITE_TOKEN }}

# Zip and upload the static site.
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./doc/website/build

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

analyzer:
exclude:
- doc/**
11 changes: 11 additions & 0 deletions doc/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build output
/build

# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Android Studio and IntelliJ IDEA
.idea

.DS_Store
30 changes: 30 additions & 0 deletions doc/website/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
32 changes: 32 additions & 0 deletions doc/website/bin/flutter_test_robots_docs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'dart:io';

import 'package:static_shock/static_shock.dart';

Future<void> main(List<String> arguments) async {
// Configure the static website generator.
final staticShock = StaticShock()
// Here, you can directly hook into the StaticShock pipeline. For example,
// you can copy an "images" directory from the source set to build set:
..pick(DirectoryPicker.parse("images"))
// All 3rd party behavior is added through plugins, even the behavior
// shipped with Static Shock.
..plugin(const MarkdownPlugin())
..plugin(const JinjaPlugin())
..plugin(const PrettyUrlsPlugin())
..plugin(const RedirectsPlugin())
..plugin(const SassPlugin())
..plugin(DraftingPlugin(
showDrafts: arguments.contains("preview"),
))
..plugin(const PubPackagePlugin({
"flutter_test_robots",
}))
..plugin(
GitHubContributorsPlugin(
authToken: Platform.environment["github_doc_website_token"],
),
);

// Generate the static website.
await staticShock.generateSite();
}
Loading

0 comments on commit 5b36369

Please sign in to comment.