-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
515f565
commit 0b7d8a8
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build HTML | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
token: ${{ secrets.PAT }} | ||
- uses: subosito/flutter-action@v2.3.0 | ||
with: | ||
channel: stable | ||
- name: Clone deployment repo | ||
run: | | ||
git clone --single-branch "https://${{ secrets.PAT }}@github.com/searchy2/Demo.git" "clone_dir" | ||
rm -rf clone_dir/flutterwebsites/flutterwebsite-html/ | ||
mkdir -p clone_dir/flutterwebsites/flutterwebsite-html/ | ||
- name: Build | ||
run: | | ||
flutter build web --release --base-href /flutterwebsites/flutterwebsite-html/ --web-renderer html | ||
mv build/web/* clone_dir/flutterwebsites/flutterwebsite-html | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y%m%d')" | ||
- name: Get time in seconds | ||
id: seconds | ||
run: echo "::set-output name=seconds::$(date +'%s')" | ||
- name: Push build commit | ||
run: | | ||
cd clone_dir | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git add * | ||
git commit -m "Build Flutter Website HTML ${{ steps.date.outputs.date }} (${{ steps.seconds.outputs.seconds }})" | ||
git pull --rebase | ||
git push |