52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Build & deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: 'stable'
|
|
flutter-version: '3.32.5'
|
|
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Build release project
|
|
run: flutter build web --base-href /chatmcp/
|
|
|
|
- name: Upload production-ready build files
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: production-files
|
|
path: build/web
|
|
|
|
deploy:
|
|
name: Deploy
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: production-files
|
|
path: build/web
|
|
|
|
- name: Deploy to gh-pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.MY_GITHUB_TOKEN }}
|
|
publish_dir: build/web |