This repository has been archived by the owner on Dec 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
name: Flutter Web | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build Web | ||
|
@@ -11,31 +13,35 @@ jobs: | |
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
flutter-version: 3.22.2 | ||
flutter-version: '3.22.2' | ||
- run: flutter config --enable-web | ||
- run: flutter pub get | ||
- name: Generate .env file | ||
run: | | ||
cat > assets/.env <<EOF | ||
SUPABASE_URL=${SUPABASE_URL} | ||
SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY} | ||
EOF | ||
- run: flutter build web --release | ||
echo "SUPABASE_URL=${SUPABASE_URL}" >> .env | ||
echo "SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY}" >> .env | ||
- name: Copy .env to assets | ||
run: | | ||
mkdir -p assets/env | ||
cp .env assets/env/.env | ||
- name: Build Web | ||
run: flutter build web --release | ||
env: | ||
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | ||
FLUTTER_ROOT: /opt/hostedtoolcache/flutter/stable-3.22.2-x64 | ||
PUB_CACHE: /home/runner/.pub-cache | ||
- run: | | ||
# 2. change path to [existed lib/main.dart path]/build/web | ||
cd build/web | ||
git init | ||
# 3. change your email | ||
git config --global user.email [email protected] | ||
# 4. change your name | ||
git config --global user.name suu3 | ||
git config --global user.email "[email protected]" # 변경된 이메일 | ||
git config --global user.name "suu3" # 변경된 이름 | ||
git status | ||
# 5. change your repository | ||
git remote add origin https://suu3:${{ secrets.GIT_ACTION_TOKEN }}@github.com/suu3/flutter-riverpod-demo.git | ||
git remote add origin https://suu3:${{ secrets.GIT_ACTION_TOKEN }}@github.com/suu3/flutter-riverpod-demo.git # 변경된 리포지토리 | ||
git checkout -b gh-pages | ||
git add --all | ||
git commit -m "update" | ||
|