Skip to content

Commit

Permalink
Merge pull request #6 from alexchristianqr/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alexchristianqr authored Jan 10, 2025
2 parents 787e98b + 64e2ca1 commit 08c570a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
- name: "Install Angular CLI"
run: npm install @angular/cli

- name: "Generate environment.production.ts"
run: |
node generate-env.ts
- name: "Build the project"
run: npm run build

Expand Down
27 changes: 27 additions & 0 deletions generate-env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { writeFileSync } from "fs";
import * as dotenv from "dotenv";

// Cargar las variables de entorno
dotenv.config();

const firebaseConfig = {
apiKey: process.env["ANGULAR_FIREBASE_API_KEY"],
authDomain: process.env["ANGULAR_FIREBASE_AUTH_DOMAIN"],
projectId: process.env["ANGULAR_FIREBASE_PROJECT_ID"],
storageBucket: process.env["ANGULAR_FIREBASE_STORAGE_BUCKET"],
messagingSenderId: process.env["ANGULAR_FIREBASE_MESSAGING_SENDER_ID"],
appId: process.env["ANGULAR_FIREBASE_APP_ID"],
measurementId: process.env["ANGULAR_FIREBASE_MEASUREMENT_ID"],
databaseURL: process.env["ANGULAR_FIREBASE_DATABASE_URL"]
};

const content = `
export const environment = {
production: true,
firebase: ${JSON.stringify(firebaseConfig, null, 2)}
};
`;

writeFileSync("src/environments/environment.production.ts", content);

console.log("Environment variables written to environment.production.ts");
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@ngrx/store-devtools": "^15.1.0",
"@okta/okta-auth-js": "7.2.0",
"bootstrap": "^5.2.3",
"dotenv": "^16.4.7",
"firebase": "^9.16.0",
"rxjs": "~7.8.0",
"sass-loader": "^16.0.4",
Expand Down
1 change: 0 additions & 1 deletion src/environments/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*
!.gitignore
!environment.ts
!environment.production.ts
13 changes: 0 additions & 13 deletions src/environments/environment.production.ts

This file was deleted.

0 comments on commit 08c570a

Please sign in to comment.