Skip to content

Commit b3c4ee2

Browse files
committed
Update deploy actions
1 parent 31717e4 commit b3c4ee2

File tree

4 files changed

+80
-27
lines changed

4 files changed

+80
-27
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Deploy (Live!)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
BASE_HREF: "web"
8+
REMOTE_DIR: "web"
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build_web.yml
12+
13+
deploy:
14+
needs: build
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Download build artifact
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: web-build
22+
path: build/web
23+
24+
- name: Update base href in index.html
25+
run: sed -i 's|<base href="/">|<base href="/${{ env.BASE_HREF }}/">|g' build/web/index.html
26+
27+
- name: Upload to SFTP
28+
uses: wlixcc/[email protected]
29+
with:
30+
server: ${{ secrets.FTP_SERVER }}
31+
username: ${{ secrets.FTP_USERNAME }}
32+
password: ${{ secrets.FTP_PASSWORD }}
33+
local_path: ./build/web/*
34+
remote_path: wonderous.app/${{ env.REMOTE_DIR }}
35+
sftp_only: true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Stage
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
BASE_HREF: "web-staging"
8+
REMOTE_DIR: "web-staging"
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build_web.yml
12+
13+
deploy:
14+
needs: build
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Download build artifact
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: web-build
22+
path: build/web
23+
24+
- name: Update base href in index.html
25+
run: sed -i 's|<base href="/">|<base href="/${{ env.BASE_HREF }}/">|g' build/web/index.html
26+
27+
- name: Upload to SFTP
28+
uses: wlixcc/[email protected]
29+
with:
30+
server: ${{ secrets.FTP_SERVER }}
31+
username: ${{ secrets.FTP_USERNAME }}
32+
password: ${{ secrets.FTP_PASSWORD }}
33+
local_path: ./build/web/*
34+
remote_path: wonderous.app/${{ env.REMOTE_DIR }}
35+
sftp_only: true

.github/workflows/build_web.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: Build and Deploy Flutter Web App
1+
name: Build Flutter Web
22

33
on:
4-
# push:
5-
# branches:
6-
# - main
74
workflow_dispatch:
8-
5+
workflow_call:
6+
97
jobs:
10-
build-and-deploy:
8+
build:
119
runs-on: ubuntu-latest
1210

1311
steps:
@@ -27,14 +25,11 @@ jobs:
2725
run: flutter config --enable-web
2826

2927
- name: Build Flutter web app
30-
run: flutter build web --release --wasm
28+
run: flutter build web --wasm
3129

32-
- name: Upload to SFTP
33-
uses: wlixcc/[email protected]
30+
- name: Upload build artifact
31+
uses: actions/upload-artifact@v4
3432
with:
35-
server: ${{ secrets.FTP_SERVER }}
36-
username: ${{ secrets.FTP_USERNAME }}
37-
password: ${{ secrets.FTP_PASSWORD }}
38-
local_path: build/web/
39-
remote_path: /wonderous.app/web_test/
40-
sftp_only: true
33+
name: web-build
34+
path: build/web
35+
retention-days: 1 # Adjust as needed

.github/workflows/tests.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)