-
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (131 loc) · 5.5 KB
/
dart.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Deploy website with all dependencies
env:
LOCAL_ASSETS_FOLDER: "assets"
on:
push:
branches: ["main", "dev"]
jobs:
build:
name: 🚀 Deploy website on push
#runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/[email protected]
- name: Set up Python 3.11
uses: actions/[email protected]
with:
python-version: "3.11"
# You can test your matrix by printing the current Python version
- name: Setup python env
run: |
pip install git+https://github.com/Kataglyphis/WebDavClient
- name: Download blog content
run: |
echo $(pwd)
ls
python -c "import sys; print(sys.version)"
# echo "$(pwd)/$LOCAL_ASSETS_FOLDER"
# echo "$(pwd)/$LOCAL_ASSETS_FOLDER"
python scripts/download_markdown_files.py ${{ secrets.WEBDAV_HOSTNAME }} ${{ secrets.WEBDAV_USERNAME }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.REMOTE_BASE_PATH }} "$LOCAL_ASSETS_FOLDER"
# echo "After executing .md deploy script the asset folder has following content:"
# ls "$(pwd)/$LOCAL_ASSETS_FOLDER"
# echo "Verifying downloaded files in assets folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER"
# echo "Verifying downloaded files in assets/documents/books/ folder:"
# ls -R "$LOCAL_ASSETS_FOLDER/documents/books"
# echo "Verifying downloaded files in $(pwd)/assets/documents/books/ folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER/documents/books"
# echo "After executing .md deploy script the asset folder has following content:"
# ls "$(pwd)/$LOCAL_ASSETS_FOLDER"
# echo "Verifying downloaded files in assets folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER"
# echo "Verifying downloaded files in assets/documents/books/ folder:"
# ls -R "$LOCAL_ASSETS_FOLDER/documents/books"
# echo "Verifying downloaded files in $(pwd)/assets/documents/books/ folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER/documents/books"
# - name: Verify downloaded files
# run: |
# echo "Verifying downloaded files in assets folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER"
# - name: Verify downloaded files
# run: |
# echo "Verifying downloaded files in assets folder:"
# ls -R "$(pwd)/$LOCAL_ASSETS_FOLDER"
- name: Setup Flutter SDK
uses: flutter-actions/[email protected]
with:
channel: stable
version: 3.24.5
# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
# - uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: |
git submodule update --init --recursive
flutter pub get
cd external/jotrockenmitlockenrepo
flutter pub get
# Uncomment this step to verify the use of 'dart format' on each commit.
- name: Verify formatting
continue-on-error: true
run: dart format --output=none --set-exit-if-changed .
# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
continue-on-error: true
run: dart analyze
# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
run: |
flutter test
- name: Enable flutter web
run: |
flutter config --enable-web
# for production I do not use wasm yet!
- name: "Build Web App"
if: github.ref == 'refs/heads/main'
run: |
flutter build web --release --wasm
- name: "Build Web App (WASM)"
if: github.ref == 'refs/heads/dev'
id: build-wasm
continue-on-error: true
run: |
flutter build web --release --wasm
- name: 📂 Sync files to main domain
if: github.ref == 'refs/heads/main'
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.SERVER }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PW }}
local-dir: "./build/web/"
- name: 📂 Sync files to dev wasm domain
if: github.ref == 'refs/heads/dev' #&& steps.build-wasm.outputs.should_run == 'true'
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.SERVER }}
username: ${{ secrets.DEV_WASM_USERNAME }}
password: ${{ secrets.DEV_WASM_PW }}
local-dir: "./build/web/"
- name: "Build Web App with canavaskit"
if: github.ref == 'refs/heads/dev'
run: |
ls -R assets/
flutter build web --release --web-renderer canvaskit
- name: 📂 Sync files to dev domain
if: github.ref == 'refs/heads/dev'
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.SERVER }}
username: ${{ secrets.DEV_USERNAME }}
password: ${{ secrets.DEV_PW }}
local-dir: "./build/web/"