-
Notifications
You must be signed in to change notification settings - Fork 74
69 lines (58 loc) · 2.06 KB
/
gh-pages.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
on:
pull_request:
paths:
- "**/*.dart"
name: Deploy PR on Github Pages
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
deploy:
name: Build web version and deploy
runs-on: ubuntu-latest
environment:
name: PR-${{ github.event.pull_request.number }}
url: ${{ steps.configure.outputs.URL }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.2"
channel: "stable"
cache: true
cache-key: deps-${{ hashFiles('**/pubspec.lock') }} # optional, change this to force refresh cache
cache-path: ${{ runner.tool_cache }}/flutter # optional, change this to specify the cache path
- name: Run prebuild
run: ./scripts/prebuild.sh
- name: Configure environments
id: configure
env:
FOLDER: ${{ github.event.pull_request.number }}
run: ./scripts/configure-web-environment.sh
- name: Build
env:
FOLDER: ${{ github.event.pull_request.number }}
run: ./scripts/build-web.sh
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: ${{ github.event.pull_request.number }}
keep_files: true
publish_dir: "build/web"
- name: Find deployment comment
uses: peter-evans/find-comment@v3
id: fc
with:
comment-author: "github-actions[bot]"
issue-number: ${{ github.event.pull_request.number }}
body-includes: "This PR has been deployed to"
- name: Create or update deployment comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
This PR has been deployed to ${{ steps.configure.outputs.URL }}.
edit-mode: replace