forked from erickzanardo/flutter-gh-pages
-
Notifications
You must be signed in to change notification settings - Fork 26
/
action.yml
53 lines (50 loc) · 1.63 KB
/
action.yml
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
name: 'Deploy Flutter web app to github pages'
description: 'Automates the build and deployment of your Flutter web app on Github gh pages'
author: 'bluefireteam'
branding:
color: blue
icon: code
inputs:
webRenderer:
description: 'Which web renderer to be used, default is auto'
required: false
default: auto
workingDir:
description: 'The directory where the project is (default .)'
required: false
default: .
targetBranch:
required: false
default: gh-pages
baseHref:
description: 'base href (if applicable)'
required: false
default: "/"
customArgs:
description: 'Custom args like: --dart-define="simple=example"'
required: false
default:
runs:
using: 'composite'
steps:
- run: flutter config --enable-web
shell: bash
working-directory: ${{inputs.workingDir}}
- run: flutter build web --release --web-renderer=${{inputs.webRenderer}} --base-href ${{inputs.baseHref}} ${{inputs.customArgs}}
shell: bash
working-directory: ${{inputs.workingDir}}
- run: git config user.name github-actions
shell: bash
working-directory: ${{inputs.workingDir}}
- run: git config user.email [email protected]
shell: bash
working-directory: ${{inputs.workingDir}}
- run: git --work-tree build/web add --all
shell: bash
working-directory: ${{inputs.workingDir}}
- run: git commit -m "Automatic deployment by github-actions"
shell: bash
working-directory: ${{inputs.workingDir}}
- run: git push origin HEAD:${{inputs.targetBranch}} --force
shell: bash
working-directory: ${{inputs.workingDir}}