51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
name: Build and deploy
|
|
run-name: Food delivery
|
|
on: push
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Archive project
|
|
run: |
|
|
mkdir -p dist/downloads
|
|
zip -r dist/downloads/archive.zip . -x '.git/*' -x '.github/*' -x '.gitea/*' -x 'dist/*' -x 'build/*'
|
|
|
|
- name: Build project
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.24.5
|
|
- run: flutter pub get
|
|
- run: dart run build_runner build --delete-conflicting-outputs
|
|
#- run: flutter test
|
|
- run: flutter build web --base-href=/b5239596a3/ --release
|
|
#- run: flutter build web --base-href=/b5239596a3/ --profile --dart-define=Dart2jsOptimization=O0
|
|
|
|
- name: Create releases
|
|
run: |
|
|
(cd build/web && zip -r ../../dist/downloads/web.zip .)
|
|
echo 'android' >> dist/downloads/app.apk
|
|
mv build/web/* dist/
|
|
mkdir b5239596a3 && mv dist/* b5239596a3/ && mv b5239596a3 dist/
|
|
|
|
- name: Setup database
|
|
uses: appremix/mysql-deploy-action@v1
|
|
with:
|
|
DATABASE_HOST: '${{ vars.db_hostname }}'
|
|
DATABASE_PORT: '${{ vars.db_port }}'
|
|
DATABASE_NAME: ''
|
|
DATABASE_USERNAME: '${{ secrets.db_username }}'
|
|
DATABASE_PASSWORD: '${{ secrets.db_password }}'
|
|
DATABASE_SCRIPT: 'database.sql'
|
|
|
|
- name: Deploy project
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
with:
|
|
server: ${{ vars.ftp_server }}
|
|
username: ${{ secrets.ftp_username }}
|
|
password: ${{ secrets.ftp_password }}
|
|
local-dir: ./dist/
|
|
server-dir: ./ |