blob: 0f8f752eb4e2af75d3ed2af9e6210e2c8aea98e1 [file] [log] [blame]
name: Deploy to web
on:
workflow_dispatch:
# Enable manual run
inputs:
environment:
description: 'Environment to deploy to (staging OR prod)'
required: true
default: 'staging'
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build-and-deploy:
runs-on: ubuntu-18.04
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@v1.5.0
with:
channel: master
- run: flutter doctor -v
- name: Install web dependencies
uses: actions/setup-node@v1
with:
node-version: '14'
- run: npm install -g firebase-tools
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@v2
- run: flutter pub get
# Build and deploy (by default, to staging).
- run: flutter build -v web --release
- run: firebase deploy -P ${{ github.event.inputs.environment || 'staging' }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}