blob: e5a654a1db8993aa018402c4be6729baf4e82267 [file] [log] [blame]
name: Deploy to web
on:
# Enable manual run
workflow_dispatch:
inputs:
environment:
description: "Environment to deploy web build"
required: true
default: "staging"
type: choice
options:
- staging
- prod
# Declare default permissions as read only.
permissions: read-all
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@6c2e035f2692eeac890d854df95630c72673f130
with:
channel: master
- run: flutter doctor -v
- name: Install web dependencies
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
with:
node-version: "14"
- run: npm install -g firebase-tools@11.0.1
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: flutter pub get
# Build and deploy (by default, to staging).
- run: flutter build -v web --release
- run: firebase deploy --only hosting:${{ github.event.inputs.environment || 'staging' }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}