From b3c0d6151c541b3a4ad86df7c3e7183c27e05fdb Mon Sep 17 00:00:00 2001 From: claustra01 Date: Sat, 10 Aug 2024 01:14:12 +0900 Subject: [PATCH] add: lighthouse ci test --- .github/workflows/pr-lighthouse.yml | 33 +++++++++++++++++++++++++++++ firebase.json | 19 +++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pr-lighthouse.yml diff --git a/.github/workflows/pr-lighthouse.yml b/.github/workflows/pr-lighthouse.yml new file mode 100644 index 0000000..577180d --- /dev/null +++ b/.github/workflows/pr-lighthouse.yml @@ -0,0 +1,33 @@ +name: Lighthouse-CI + +on: + push: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: | + npm install + npm run build + + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_VIRTUAL_NATSUMATSURI }} + channelId: live + projectId: virtual-natsumatsuri + target: dev + + lighthouse: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: | + npm install && npm install -g @lhci/cli@0.14.x + npm run build + lhci autorun + \ No newline at end of file diff --git a/firebase.json b/firebase.json index 2c33c29..4566b19 100644 --- a/firebase.json +++ b/firebase.json @@ -1,5 +1,5 @@ { - "hosting": { + "hosting": [{ "public": "dist", "ignore": [ "firebase.json", @@ -12,5 +12,20 @@ "destination": "/index.html" } ] - } + }, + { + "target": "dev", + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + }] }