Skip to content

Commit

Permalink
testing cic d
Browse files Browse the repository at this point in the history
  • Loading branch information
feniln64 committed May 4, 2024
1 parent 088986e commit ef50c60
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"projects": {
"default": "dcp-dev"
},
"targets": {
"dcp-dev": {
"hosting": {
"main": [
"dcp-dev"
],
"dev": [
"docopypaste-dfb15"
]
}
}
}
}


6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build-and-deploy
on:
push:
branches: ['main', 'testing']
branches: ['main']


jobs:
Expand Down Expand Up @@ -75,4 +75,6 @@ jobs:
ls -al
cd copypaste_react
ls
git pull
git pull
docker compose up -d --build
docker image prune -f
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to Firebase Hosting

on:
push:
branches:
- dev

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: check branch
run: echo ${{ github.ref_name }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: check all files
run: ls

- name: Install dependencies
run: npm ci

- name: Build the app
run: npm run build
env:
CI: false
REACT_APP_PUBLIC_POSTHOG_KEY: ${{ secrets.REACT_APP_PUBLIC_POSTHOG_KEY }}
REACT_APP_PUBLIC_POSTHOG_HOST: ${{ secrets.REACT_APP_PUBLIC_POSTHOG_HOST }}
- name: install firebase tools
run: npm install -g firebase-tools

- name: Deploy to Firebase
run : firebase deploy --only hosting:${{ github.ref_name }} --token ${{ secrets.FIREBASE_TOKEN }}
27 changes: 27 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"hosting": [
{
"public": "build",
"target": "main",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"public": "build",
"target": "dev",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}

0 comments on commit ef50c60

Please sign in to comment.