-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.28 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build and deploy for web
on:
push:
branches:
- main
# Enable running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: 'Create .env file'
run: echo "${{ secrets.ENV_FILE_CONTENT }}" > .env
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.13.6'
- name: Install dependencies
run: flutter pub get
# CI is set to false to prevent treating warnings as errors
- name: Build Flutter for Web
run: CI=false flutter build web --web-renderer canvaskit --release --no-tree-shake-icons
- name: Run Post-Build Script
run: |
chmod 755 ./post_build.sh
./post_build.sh
- name: Upload build files to VPS via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
rm: true
source: "./build/web/*"
target: "${{ secrets.SCP_TARGET }}"
strip_components: 2