Skip to content

Commit

Permalink
Update deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
esDotDev committed Sep 26, 2024
1 parent 31717e4 commit b3c4ee2
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 27 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build_and_deploy_web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Deploy (Live!)

on:
workflow_dispatch:

env:
BASE_HREF: "web"
REMOTE_DIR: "web"
jobs:
build:
uses: ./.github/workflows/build_web.yml

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: web-build
path: build/web

- name: Update base href in index.html
run: sed -i 's|<base href="/">|<base href="/${{ env.BASE_HREF }}/">|g' build/web/index.html

- name: Upload to SFTP
uses: wlixcc/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local_path: ./build/web/*
remote_path: wonderous.app/${{ env.REMOTE_DIR }}
sftp_only: true
35 changes: 35 additions & 0 deletions .github/workflows/build_and_deploy_web_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Stage

on:
workflow_dispatch:

env:
BASE_HREF: "web-staging"
REMOTE_DIR: "web-staging"
jobs:
build:
uses: ./.github/workflows/build_web.yml

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: web-build
path: build/web

- name: Update base href in index.html
run: sed -i 's|<base href="/">|<base href="/${{ env.BASE_HREF }}/">|g' build/web/index.html

- name: Upload to SFTP
uses: wlixcc/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local_path: ./build/web/*
remote_path: wonderous.app/${{ env.REMOTE_DIR }}
sftp_only: true
25 changes: 10 additions & 15 deletions .github/workflows/build_web.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Build and Deploy Flutter Web App
name: Build Flutter Web

on:
# push:
# branches:
# - main
workflow_dispatch:

workflow_call:

jobs:
build-and-deploy:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -27,14 +25,11 @@ jobs:
run: flutter config --enable-web

- name: Build Flutter web app
run: flutter build web --release --wasm
run: flutter build web --wasm

- name: Upload to SFTP
uses: wlixcc/[email protected]
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local_path: build/web/
remote_path: /wonderous.app/web_test/
sftp_only: true
name: web-build
path: build/web
retention-days: 1 # Adjust as needed
12 changes: 0 additions & 12 deletions .github/workflows/tests.yaml

This file was deleted.

0 comments on commit b3c4ee2

Please sign in to comment.