Skip to content

Commit

Permalink
back to netlify
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffery Orazulike <chukwudumebiorazulike@gmail.com>
  • Loading branch information
logickoder committed Dec 23, 2024
1 parent a50c4de commit 550d62d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 29 deletions.
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

45 changes: 31 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Build and Deploy to Netlify

name: Deploy to Firebase Hosting
on: [ push, workflow_dispatch ]

on:
push:
branches:
- main
env:
BRANCH_NAME: ${{ github.ref_name }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_deploy:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,15 +25,31 @@ jobs:
with:
version: 9

- name: Install Netlify
run: pnpm install netlify-cli -g

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Build Application
run: pnpm run build

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_INCROP_4703C }}
channelId: live
projectId: incrop-4703c
- name: Deploy to Netlify
id: netlify_deploy
run: |
prod_flag=""
if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
netlify deploy \
--dir dist/client \
--site ${{ secrets.NETLIFY_SITE_ID }} \
--auth ${{ secrets.NETLIFY_API_TOKEN }} \
$prod_flag \
--json \
> deploy_output.json
- name: Generate URL Preview
id: url_preview
if: ${{ env.BRANCH_NAME != 'main' }}
run: |
NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
echo "NETLIFY_PREVIEW_URL=$NETLIFY_PREVIEW_URL" >> "$GITHUB_OUTPUT"
10 changes: 0 additions & 10 deletions firebase.json

This file was deleted.

21 changes: 21 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build]
command = "pnpm run build"
functions = "netlify/functions"
publish = "dist/client"

## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
[[redirects]]
from = "/*"
to = "/:splat/"
status = 301
force = true

## (optional) Settings for Netlify Dev
## https://github.com/netlify/cli/blob/main/docs/netlify-dev.md#project-detection
#[dev]
# command = "yarn start" # Command to start your dev server
# port = 3000 # Port that the dev server will be listening on
# publish = "dist" # Folder with the static content for _redirect file

## more info on configuring this file: https://ntl.fyi/file-based-build-config

0 comments on commit 550d62d

Please sign in to comment.