Bump actions/checkout from 4.1.7 to 4.2.0 (#1739) #172
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
# 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 | |
paths: | |
# We only build and deploy a new version, when a user relevant files | |
# changed. | |
- "website/**" | |
# We trigger also this workflow, if this workflow is changed, so that new | |
# changes will be applied. | |
- ".github/workflows/website_cd.yml" | |
# The following paths are excluded from the above paths. It's important to | |
# list the paths at the end of the file, so that the exclude paths are | |
# applied. | |
# | |
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths. | |
- "!**/*.md" | |
- "!**/*.mdx" | |
- "!**/*.gitignore" | |
# The macOS version is only used for debugging. | |
- "!website/macos/**" | |
# Test files are not relevant for the website deployment. | |
- "!**/test/**" | |
- "!**/test_driver/**" | |
- "!**/integration_test/**" | |
- "!**/analysis_options.yaml" | |
- "!**/dart_test.yaml" | |
# Allows you to run this workflow manually from the Actions tab. | |
# | |
# Since the website depends on the /lib folder, it could be that the website | |
# requires a new deployment. In this case, the developer needs to trigger the | |
# deployment manually or wait until the next change "website/**" is pushed. We | |
# do this to avoid unnecessary deployments since a new deployment invalidates | |
# the cache. | |
workflow_dispatch: | |
# Set permissions to none. | |
# | |
# Using the broad default permissions is considered a bad security practice | |
# and would cause alerts from our scanning tools. | |
permissions: {} | |
env: | |
CI_CD_DART_SCRIPTS_PACKAGE_PATH: "tools/sz_repo_cli/" | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
name: website-deploy-${{ matrix.environment.flavor }} | |
permissions: | |
checks: write # for FirebaseExtended/action-hosting-deploy | |
strategy: | |
matrix: | |
environment: | |
- flavor: dev | |
projectId: sharezone-debug | |
serviceAccountSecret: FIREBASE_SERVICE_ACCOUNT_SHAREZONE_DEBUG | |
- flavor: prod | |
projectId: sharezone-c2bd8 | |
serviceAccountSecret: FIREBASE_HOSTING_PROD_KEY | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | |
- name: Set Flutter version from FVM config file to environment variables | |
id: fvm-config-action | |
uses: kuhnroyal/flutter-fvm-config-action@4155f8ca4c30a4f2f50df69caa0e4259f6cd1142 | |
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 | |
with: | |
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | |
- name: Install Sharezone CLI | |
run: | | |
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH" | |
echo $(pwd)/bin >> $GITHUB_PATH | |
- name: Install Firebase CLI | |
run: npm i -g [email protected] | |
- name: Build and deploy website | |
env: | |
FIREBASE_HOSTING_KEY: ${{ secrets[matrix.environment.serviceAccountSecret] }} | |
run: | | |
echo $FIREBASE_HOSTING_KEY > firebase-hosting-key.json | |
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/firebase-hosting-key.json | |
sz deploy website \ | |
--message "Workflow $GITHUB_JOB, commit $GITHUB_SHA" \ | |
--flavor ${{ matrix.environment.flavor }} |