Skip to content

Commit 0b7d8a8

Browse files
Create build_html.yml
1 parent 515f565 commit 0b7d8a8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/build_html.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build HTML
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
submodules: recursive
13+
token: ${{ secrets.PAT }}
14+
- uses: subosito/flutter-action@v2.3.0
15+
with:
16+
channel: stable
17+
- name: Clone deployment repo
18+
run: |
19+
git clone --single-branch "https://${{ secrets.PAT }}@github.com/searchy2/Demo.git" "clone_dir"
20+
rm -rf clone_dir/flutterwebsites/flutterwebsite-html/
21+
mkdir -p clone_dir/flutterwebsites/flutterwebsite-html/
22+
- name: Build
23+
run: |
24+
flutter build web --release --base-href /flutterwebsites/flutterwebsite-html/ --web-renderer html
25+
mv build/web/* clone_dir/flutterwebsites/flutterwebsite-html
26+
- name: Get current date
27+
id: date
28+
run: echo "::set-output name=date::$(date +'%Y%m%d')"
29+
- name: Get time in seconds
30+
id: seconds
31+
run: echo "::set-output name=seconds::$(date +'%s')"
32+
- name: Push build commit
33+
run: |
34+
cd clone_dir
35+
git config user.name github-actions
36+
git config user.email github-actions@github.com
37+
git add *
38+
git commit -m "Build Flutter Website HTML ${{ steps.date.outputs.date }} (${{ steps.seconds.outputs.seconds }})"
39+
git pull --rebase
40+
git push

0 commit comments

Comments
 (0)