Build and deploy docs via GitHub action

This commit is contained in:
Simon Binder
2021-03-12 22:12:20 +01:00
parent ba95127cab
commit 38b4f094e9
4 changed files with 37 additions and 19 deletions
+34
View File
@@ -0,0 +1,34 @@
name: Build and deploy to netlify
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- name: Get dependencies
run: dart pub get
working-directory: docs
- name: Run build
run: dart run build_runner build --release
working-directory: docs
- name: Output generated pages
run: >-
dart run build_runner build --release --output web:deploy
rm -rf deploy/packages deploy/build.manifest deploy/.dart_tool deploy/.packages
working-directory: docs
- name: Deploy to netlify
uses: nwtgck/actions-netlify@v1.1
with:
production-branch: master
enable-pull-request-comment: true
enable-commit-comment: false
netlify-config-path: "./netlify.toml"
alias: deploy-preview-${{ github.event.number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
+2
View File
@@ -11,3 +11,5 @@ benchmark_results.json
.flutter-plugins
.flutter-plugins-dependencies
flutter_export_environment.sh
# Local Netlify folder
.netlify
-2
View File
@@ -1,9 +1,7 @@
# We use netlify to deploy the documentation.
[build]
base = ""
publish = "docs/deploy"
command = 'tool/netlify_build.sh'
[[redirects]]
from = "https://moor.netlify.app/*"
-16
View File
@@ -1,16 +0,0 @@
curl https://storage.googleapis.com/dart-archive/channels/stable/release/latest/linux_packages/dart_2.12.1-1_amd64.deb --output /tmp/dart.deb
dpkg -i /tmp/dart.deb
cd docs
dart pub get
if [[ -v BUILD_RELEASE ]]
then
dart run build_runner build --release
dart run build_runner build --release --output web:deploy
else
dart run build_runner build
dart run build_runner build --output web:deploy
fi
rm -r deploy/packages