From 9a1e21cbd75b2de2b1562b4174b77e955a4a2686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kopoci=C5=84ski?= Date: Fri, 18 Oct 2024 14:46:50 +0200 Subject: [PATCH] chore(storybook): set up Firebase --- .firebaserc | 5 +++++ .github/workflows/firebase-hosting-merge.yml | 21 ++++++++++++++++++ .../firebase-hosting-pull-request.yml | 22 +++++++++++++++++++ firebase.json | 6 +++++ 4 files changed, 54 insertions(+) create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 firebase.json diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 000000000..12962797e --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "aybolit-449f1" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 000000000..466e612ef --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,21 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on merge +on: + push: + branches: + - master +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: export NODE_OPTIONS=--openssl-legacy-provider && yarn && yarn build && yarn --cwd + packages/storybook build-storybook + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_AYBOLIT_449F1 }} + channelId: live + projectId: aybolit-449f1 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 000000000..40e5c7951 --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,22 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on PR +on: pull_request +permissions: + checks: write + contents: read + pull-requests: write +jobs: + build_and_preview: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: export NODE_OPTIONS=--openssl-legacy-provider && yarn && yarn build && yarn --cwd + packages/storybook build-storybook + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_AYBOLIT_449F1 }} + projectId: aybolit-449f1 diff --git a/firebase.json b/firebase.json new file mode 100644 index 000000000..7901fc2bd --- /dev/null +++ b/firebase.json @@ -0,0 +1,6 @@ +{ + "hosting": { + "public": "packages/storybook/storybook-static", + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] + } +}