forked from suesitran/public_chat
-
-
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.
Merge and deploy script (suesitran#19)
* first draft of merge and deploy script * Change to use pull_request trigger * Add firebase.json * Change to use self-hosted * do not need to install Firebase CLI
- Loading branch information
1 parent
ef4ee04
commit 728bce9
Showing
1 changed file
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Deploy to web after merge | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# push: # trigger at each merge to main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
validate-and-build-apps: | ||
name: 'Validate and build web app' | ||
runs-on: self-hosted | ||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
steps: | ||
- name: checkout source code | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{github.event.pull_request_target.head.ref}} | ||
repository: ${{github.event.pull_request_target.head.repo.full_name}} | ||
fetch-depth: 0 | ||
- name: setup secrets | ||
run: | | ||
echo "$FIREBASE_OPTION" > lib/firebase_options.dart | ||
env: | ||
FIREBASE_OPTION: ${{ secrets.FIREBASE_OPTIONS }} | ||
- name: Install Flutter | ||
uses: subosito/[email protected] | ||
with: | ||
flutter-version: '3.22.0' | ||
channel: 'stable' | ||
# run firebase deploy --only hosting to deploy when development is done | ||
- name: build and deploy web app | ||
run: | | ||
echo "$FIREBASE_JSON" > firebase.json | ||
flutter pub get | ||
flutter build web | ||
firebase hosting:channel:deploy testing | ||
env: | ||
FIREBASE_JSON: ${{ secrets.FIREBASE_JSON }} |