Skip to content

Github Actions Automation #2 #8

Github Actions Automation #2

Github Actions Automation #2 #8

Workflow file for this run

name: Build Canvas
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PAT }}
- uses: subosito/flutter-action@v2
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/minimal-canvas/
mkdir -p clone_dir/flutterwebsites/minimal-canvas/
- name: Build
run: |
flutter build web --release --base-href /flutterwebsites/minimal-canvas/ --web-renderer canvaskit
mv build/web/* clone_dir/flutterwebsites/minimal-canvas
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Get time in seconds
id: seconds
run: echo "seconds=$(date +'%s')" >> $GITHUB_OUTPUT
- name: Push build commit
run: |
cd clone_dir
git config user.name github-actions
git config user.email [email protected]
git add *
git commit -m "Build Minimal Canvas ${{ steps.date.outputs.date }} (${{ steps.seconds.outputs.seconds }})"
git pull --rebase
git push