From 49f762ba6e518234e9e6aee42203a3b67c8cf303 Mon Sep 17 00:00:00 2001 From: evanalif113 Date: Thu, 31 Oct 2024 10:51:22 +0700 Subject: [PATCH] Refactor GitHub workflows: Add Node.js setup and build script --- .github/workflows/firebase-hosting-merge.yml | 13 +++++++------ package.json | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 1cb7da0..f1d9014 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -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 }} @@ -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 \ No newline at end of file + projectId: staklimjerukagung diff --git a/package.json b/package.json index 352d4f8..f145a82 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { + "scripts": { + "build": "echo 'Running build command'" + }, "dependencies": { "jslint": "^0.12.1" - }, - "scripts": { - "build": "webpack --mode production" } }