Skip to content

Commit

Permalink
Refactor GitHub workflows: Add Node.js setup and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
evanalif113 committed Oct 31, 2024
1 parent 692b676 commit 49f762b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Menambahkan environment variables dari GitHub Secrets untuk Firebase
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Sesuaikan dengan versi yang Anda butuhkan
- run: npm install
- name: Build project
run: npm run build
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
Expand All @@ -20,12 +24,9 @@ jobs:
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }}
run: npm run build

# Deploy ke Firebase Hosting
- uses: FirebaseExtended/action-hosting-deploy@v0.9.0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAKLIMJERUKAGUNG }}
channelId: live
projectId: staklimjerukagung
projectId: staklimjerukagung
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"scripts": {
"build": "echo 'Running build command'"
},
"dependencies": {
"jslint": "^0.12.1"
},
"scripts": {
"build": "webpack --mode production"
}
}

0 comments on commit 49f762b

Please sign in to comment.