-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.21 KB
/
flutter_build_pages.yaml
File metadata and controls
43 lines (41 loc) · 1.21 KB
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
name: Build & Publish to Github Pages
on:
# push:
# branches:
# - main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter --version
- name: Install dependencies
run: flutter pub get
- name: Build
run: flutter build web --release
- name: Extract repository name
run: echo "repoName=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV
- name: set Base href
run: sed -i "s|<base href=\".*\">|<base href=\"/${{ env.repoName }}/\">|g" build/web/index.html
- name: Install ZIP tool
run: sudo apt-get install zip
- name: Archive
run: |
cd build
mkdir artifact
zip -r artifact/website.zip web
cd ..
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: build/artifact/website.zip
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web