Skip to content

Use Flutter/Dart SDK in Sharezone Repo CLI, if FVM is not installed (… #41

Use Flutter/Dart SDK in Sharezone Repo CLI, if FVM is not installed (…

Use Flutter/Dart SDK in Sharezone Repo CLI, if FVM is not installed (… #41

Workflow file for this run

# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt)
# Licensed under the EUPL-1.2-or-later.
#
# You may obtain a copy of the Licence at:
# https://joinup.ec.europa.eu/software/page/eupl
#
# SPDX-License-Identifier: EUPL-1.2
name: website-cd
concurrency:
# Avoids running multiple deployments at the same time which would cause
# conflicts.
group: website-release
on:
push:
branches:
- main
# Set permissions to none.
#
# Using the broad default permissions is considered a bad security practice
# and would cause alerts from our scanning tools.
permissions: {}
jobs:
deploy:
runs-on: ubuntu-22.04
name: website-deploy-${{ matrix.environment.name }}
permissions:
checks: write # for FirebaseExtended/action-hosting-deploy
strategy:
matrix:
environment:
- name: dev
projectId: sharezone-debug
serviceAccountSecret: FIREBASE_SERVICE_ACCOUNT_SHAREZONE_DEBUG
- name: prod
projectId: sharezone-c2bd8
serviceAccountSecret: FIREBASE_HOSTING_PROD_KEY
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set Flutter version from FVM config file to environment variables
id: fvm-config-action
uses: kuhnroyal/flutter-fvm-config-action@6ffa30473b346f7d7c63cf9e03e6a886f940a72b
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Build
working-directory: website
run: |
# We use the canvaskit renderer because the html renderer is a bit
# buggy.
flutter build web \
--web-renderer canvaskit
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets[matrix.environment.serviceAccountSecret] }}"
channelId: live
entryPoint: "./website"
projectId: ${{ matrix.environment.projectId }}