Skip to content

Commit fe6a638

Browse files
[Docs] - Configure CI build/deploy for GitHub Pages (Resolves #51) (#52)
1 parent a24289e commit fe6a638

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and deploy website
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: ./doc/website
14+
steps:
15+
# Checkout the repository
16+
- uses: actions/checkout@v3
17+
18+
# Setup a Dart environment
19+
- uses: dart-lang/setup-dart@v1
20+
21+
# Download all the packages that the app uses
22+
- run: dart pub get
23+
24+
# Build the static site.
25+
- run: dart run bin/main.dart
26+
27+
# Zip and upload the static site.
28+
- name: Upload artifact
29+
uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: ./doc/website/build
32+
33+
deploy:
34+
name: Deploy
35+
needs: build
36+
runs-on: ubuntu-latest
37+
38+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
39+
permissions:
40+
pages: write # to deploy to Pages
41+
id-token: write # to verify the deployment originates from an appropriate source
42+
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR Validation
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build_website:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: ./doc/website
11+
steps:
12+
# Checkout the repository
13+
- uses: actions/checkout@v3
14+
15+
# Setup a Dart environment
16+
- uses: dart-lang/setup-dart@v1
17+
18+
# Download all the packages that the app uses
19+
- run: dart pub get
20+
21+
# Build the static site.
22+
- run: dart run bin/main.dart

0 commit comments

Comments
 (0)