Skip to content

Commit d7582b4

Browse files
2 parents 1667d84 + db9130c commit d7582b4

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/buildAngular.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
name: Build Angular Application
1+
name: Build and Deploy Angular App
22

33
on:
44
push:
55
branches:
6-
- main
6+
- main # Run on pushes to the main branch
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout Repository
14-
uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 1 # Shallow clone
17-
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
1816
- name: Set up Node.js
19-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v2
2018
with:
21-
node-version: '18.x'
19+
node-version: '18.x' # Adjust this to your Node.js version
2220

23-
- name: Install Dependencies
21+
- name: Install dependencies
2422
run: npm install --legacy-peer-deps
2523

26-
- name: Build Angular App
27-
run: npm run build
24+
- name: Create environment variables in .env
25+
run: |
26+
echo "BASE_API_URL=${{ secrets.BASE_API_URL }}" >> .env
27+
echo "FIREBASE_API_KEY=${{ secrets.FIREBASE_API_KEY }}" >> .env
28+
echo "FIREBASE_AUTH_DOMAIN=${{ secrets.FIREBASE_AUTH_DOMAIN }}" >> .env
29+
echo "FIREBASE_PROJECT_ID=${{ secrets.FIREBASE_PROJECT_ID }}" >> .env
30+
echo "FIREBASE_STORAGE_BUCKET=${{ secrets.FIREBASE_STORAGE_BUCKET }}" >> .env
31+
echo "FIREBASE_MESSAGING_SENDER_ID=${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}" >> .env
32+
echo "FIREBASE_APP_ID=${{ secrets.FIREBASE_APP_ID }}" >> .env
33+
echo "FIREBASE_MEASUREMENT_ID=${{ secrets.FIREBASE_MEASUREMENT_ID }}" >> .env
34+
echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" >> .env
35+
36+
- name: Build Angular application
37+
run: npm run build --prod
2838

29-
- name: Upload Build Artifacts
30-
run: echo "Done......."
39+
# You can add additional steps for deployment, for example:
40+
# - name: Deploy to hosting service (Netlify, Firebase, Vercel, etc.)

0 commit comments

Comments
 (0)