blob: ba954506bf04244007152c7bd6477b6f5bb47ba8 [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-18.04
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@5e1529bc12adae5b26f30f0a4046ac743d6f0c5d
with:
channel: master
- run: flutter doctor -v
- name: Install web dependencies
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e
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@d171c3b028d844f2bf14e9fdec0c58114451e4bf
- 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 }}