-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d7307
commit 5b36369
Showing
39 changed files
with
1,594 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
Oops, something went wrong.