Skip to content

Merge pull request #50 from fluttersdk/feat/css-positioning-utilities #26

Merge pull request #50 from fluttersdk/feat/css-positioning-utilities

Merge pull request #50 from fluttersdk/feat/css-positioning-utilities #26

Workflow file for this run

name: CI & Deploy
on:
push:
branches: [main, develop, v1]
pull_request:
branches: [main, develop, v1]
jobs:
ci:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Analyze code
run: flutter analyze
- name: Check formatting
run: dart format --set-exit-if-changed .
- name: Run tests
run: flutter test
build:
name: Build Web
needs: ci
if: false # TODO: re-enable when deploy infrastructure is ready
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: |
flutter pub get
cd example && flutter pub get
- name: Build Demo (main.dart)
working-directory: example
run: |
flutter build web --release --target lib/main.dart --base-href /
mv build/web ../demo-build
- name: Build Play (play.dart)
working-directory: example
run: |
flutter build web --release --target lib/play.dart --base-href /
mv build/web ../play-build
- name: Upload Demo artifact
uses: actions/upload-artifact@v4
with:
name: demo-build
path: demo-build/
retention-days: 1
- name: Upload Play artifact
uses: actions/upload-artifact@v4
with:
name: play-build
path: play-build/
retention-days: 1
deploy-demo:
name: Deploy Demo
needs: build
if: false # TODO: re-enable when deploy infrastructure is ready
runs-on: ubuntu-latest
environment: ${{ github.ref_name == 'main' && 'Demo Production' || 'Demo Development' }}
steps:
- name: Download Demo artifact
uses: actions/download-artifact@v4
with:
name: demo-build
path: demo-build/
- name: Deploy (attempt 1)
id: deploy
continue-on-error: true
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.SSH_HOST }}
username: ${{ vars.SSH_USER }}
port: ${{ vars.SSH_PORT }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
timeout: 60s
source: demo-build/*
target: ${{ vars.DEPLOY_PATH }}
strip_components: 1
rm: true
overwrite: true
- name: Deploy (attempt 2)
if: steps.deploy.outcome == 'failure'
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.SSH_HOST }}
username: ${{ vars.SSH_USER }}
port: ${{ vars.SSH_PORT }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
timeout: 60s
source: demo-build/*
target: ${{ vars.DEPLOY_PATH }}
strip_components: 1
rm: true
overwrite: true
deploy-play:
name: Deploy Play
needs: build
if: false # TODO: re-enable when deploy infrastructure is ready
runs-on: ubuntu-latest
environment: ${{ github.ref_name == 'main' && 'Play Production' || 'Play Development' }}
steps:
- name: Download Play artifact
uses: actions/download-artifact@v4
with:
name: play-build
path: play-build/
- name: Deploy (attempt 1)
id: deploy
continue-on-error: true
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.SSH_HOST }}
username: ${{ vars.SSH_USER }}
port: ${{ vars.SSH_PORT }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
timeout: 60s
source: play-build/*
target: ${{ vars.DEPLOY_PATH }}
strip_components: 1
rm: true
overwrite: true
- name: Deploy (attempt 2)
if: steps.deploy.outcome == 'failure'
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.SSH_HOST }}
username: ${{ vars.SSH_USER }}
port: ${{ vars.SSH_PORT }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
timeout: 60s
source: play-build/*
target: ${{ vars.DEPLOY_PATH }}
strip_components: 1
rm: true
overwrite: true