Skip to content

Commit ffb1ff0

Browse files
committed
chore: update melos and update deploy workflow for all flavors
1 parent ef73d1f commit ffb1ff0

File tree

3 files changed

+55
-77
lines changed

3 files changed

+55
-77
lines changed

.github/workflows/deploy.yaml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy
2+
23
on:
34
push:
45
branches:
56
- main
67
workflow_dispatch:
78
workflow_call:
89

9-
permissions:
10-
contents: write
11-
1210
jobs:
13-
deploy:
11+
build:
12+
permissions:
13+
contents: write
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Checkout 🛎️
16+
- name: Checkout
1717
uses: actions/checkout@v4
18-
18+
1919
- name: Setup Flutter
2020
uses: subosito/flutter-action@v2
2121
with:
@@ -43,17 +43,56 @@ jobs:
4343
- name: Run Integration Tests
4444
run: melos ci_integration_test --no-select
4545

46-
- name: Create .env.prod file
47-
run: echo "${{ secrets.DOT_ENV_FILE }}" > .env.prod
48-
4946
- name: Update GITHUB_RUN_NUMBER to version
5047
run: melos update_version
48+
49+
- name: Create .env.dev file
50+
run: echo "${{ secrets.DOT_ENV_DEV_FILE }}" > .env.dev
51+
52+
- name: Build development
53+
run: melos build_dev
54+
55+
- name: Publish to develop branch
56+
uses: JamesIves/github-pages-deploy-action@v4
57+
with:
58+
branch: develop
59+
folder: "./build/web"
5160

52-
- name: Build
61+
- name: Create .env.stg file
62+
run: echo "${{ secrets.DOT_ENV_STG_FILE }}" > .env.stg
63+
64+
- name: Build staging
65+
run: melos build_stg
66+
67+
- name: Publish to staging branch
68+
uses: JamesIves/github-pages-deploy-action@v4
69+
with:
70+
branch: staging
71+
folder: "./build/web"
72+
73+
- name: Deploy staging to Netlify
74+
uses: nwtgck/actions-netlify@v3.0
75+
with:
76+
publish-dir: "."
77+
production-branch: staging
78+
github-token: ${{ secrets.GITHUB_TOKEN }}
79+
deploy-message: "Deploy from GitHub Actions"
80+
enable-pull-request-comment: false
81+
enable-commit-comment: true
82+
overwrites-pull-request-comment: true
83+
env:
84+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
85+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
86+
timeout-minutes: 1
87+
88+
- name: Create .env.prod file
89+
run: echo "${{ secrets.DOT_ENV_FILE }}" > .env.prod
90+
91+
- name: Build production
5392
run: melos build_prod
5493

55-
- name: Deploy 🚀
94+
- name: Publish to production branch
5695
uses: JamesIves/github-pages-deploy-action@v4
5796
with:
58-
branch: gh-pages
97+
branch: production
5998
folder: "./build/web"

.github/workflows/netlify.yaml

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

melos.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ scripts:
1313
description: Run `flutter test` for all packages
1414

1515
build_dev:
16-
run: flutter build web --release --no-tree-shake-icons --target lib/main_development.dart --dart-define-from-file=.env.dev --no-source-maps --pwa-strategy=none
16+
run: flutter clean;flutter build web --release --no-tree-shake-icons --target lib/main_development.dart --dart-define-from-file=.env.dev --pwa-strategy=none
1717
description: Build app for web in development flavor
1818

1919
build_prod:
20-
run: flutter build web --release --no-tree-shake-icons --target lib/main_production.dart --dart-define-from-file=.env.prod --no-source-maps --pwa-strategy=none
20+
run: flutter clean;flutter build web --release --no-tree-shake-icons --target lib/main_production.dart --dart-define-from-file=.env.prod --no-source-maps --pwa-strategy=none
2121
description: Build app for web in production flavor
2222

2323
build_stg:
24-
run: flutter build web --release --no-tree-shake-icons --target lib/main_staging.dart --dart-define-from-file=.env.stg --no-source-maps --pwa-strategy=none
24+
run: flutter clean;flutter build web --release --no-tree-shake-icons --target lib/main_staging.dart --dart-define-from-file=.env.stg --pwa-strategy=none
2525
description: Build app for web in staging flavor
2626

2727
generate_packages:

0 commit comments

Comments
 (0)