-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated github workflows (#214)
- Loading branch information
Showing
9 changed files
with
128 additions
and
104 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: 'Firebase Deployment' | ||
on: | ||
workflow_call: | ||
inputs: | ||
timeout: | ||
required: false | ||
type: number | ||
default: 5 | ||
environment: | ||
required: true | ||
type: string | ||
is_preview: | ||
required: true | ||
type: boolean | ||
env: | ||
FIREBASE_CLI_EXPERIMENTS: webframeworks | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: ${{ inputs.timeout }} | ||
environment: ${{ inputs.environment }} | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Install Firebase CLI | ||
run: npm install -g firebase-tools | ||
- name: Install PNPM | ||
uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Setup PNPM Cache | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- name: Load Cached Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install Node dependencies | ||
run: pnpm install -r | ||
- name: Create .env File | ||
shell: bash | ||
run: | | ||
echo "NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_APP_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_MESSAGE_SENDER_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGE_SENDER_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_SEGMENT_WRITE_KEY=${{ secrets.NEXT_PUBLIC_SEGMENT_WRITE_KEY }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_BACKEND_BASE_URL=${{ env.DEVELOPMENT_DASHBOARD_BACKEND_URL }}" >> frontend/.env | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
if: ${{ inputs.is_preview == false }} | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | ||
projectId: ${{ env.GCP_PROJECT_I }} | ||
channelId: live | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
if: ${{ inputs.is_preview == true }} | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | ||
projectId: ${{ env.GCP_PROJECT_I }} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Frontend Preview | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'frontend/src/**' | ||
- 'shared/ts/**' | ||
- 'package.json' | ||
jobs: | ||
deploy: | ||
uses: ./.github/actions/deploy_firebase.yaml | ||
secrets: inherit | ||
with: | ||
environment: ${{ github.ref_name }} | ||
is_preview: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,17 @@ | ||
name: Deploy (Frontend) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'frontend/src/**' | ||
- 'shared/ts/**' | ||
push: | ||
branches: | ||
- main | ||
- development | ||
- production | ||
paths: | ||
- 'frontend/src/**' | ||
- 'shared/ts/**' | ||
env: | ||
FIREBASE_CLI_EXPERIMENTS: webframeworks | ||
|
||
- 'package.json' | ||
jobs: | ||
deploy: | ||
environment: development | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Install Firebase CLI | ||
run: npm install -g firebase-tools | ||
- name: Install PNPM | ||
uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Setup PNPM Cache | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- name: Load Cached Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install Node dependencies | ||
run: pnpm install -r | ||
- name: Create .env File | ||
shell: bash | ||
run: | | ||
echo "NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_APP_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_MESSAGE_SENDER_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGE_SENDER_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_SEGMENT_WRITE_KEY=${{ secrets.NEXT_PUBLIC_SEGMENT_WRITE_KEY }}" >> frontend/.env | ||
echo "NEXT_PUBLIC_BACKEND_BASE_URL=${{ env.DEVELOPMENT_DASHBOARD_BACKEND_URL }}" >> frontend/.env | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }} | ||
channelId: live | ||
projectId: basemind-ai-development | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }} | ||
projectId: basemind-ai-development | ||
uses: ./.github/actions/deploy_firebase.yaml | ||
secrets: inherit | ||
with: | ||
environment: ${{ github.ref_name }} | ||
is_preview: false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.