diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 5ab59c2..bd3fdad 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -11,7 +11,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: cd hosting && npm ci && node_modules/.bin/nx build + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + cache-dependency-path: hosting/package-lock.json + - run: cd hosting && npm ci + - run: cd hosting && node_modules/.bin/nx build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index b8891d1..8beeefa 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -7,9 +7,21 @@ jobs: build_and_preview: if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" runs-on: ubuntu-latest + permissions: + checks: write + contents: read + pull-requests: write steps: - uses: actions/checkout@v4 - - run: cd hosting && npm ci && node_modules/.bin/nx lint && node_modules/.bin/nx test && node_modules/.bin/nx build + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + cache-dependency-path: hosting/package-lock.json + - run: cd hosting && npm ci + - run: cd hosting && node_modules/.bin/nx lint + - run: cd hosting && node_modules/.bin/nx test + - run: cd hosting && node_modules/.bin/nx build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/firebase.json b/firebase.json index 87e822e..1a18415 100644 --- a/firebase.json +++ b/firebase.json @@ -1,13 +1,8 @@ { "hosting": { "target": "censeo", - "predeploy": "cd hosting && npm run test && npm run build", "public": "hosting/dist/censeo", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ], + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "headers": [ { "source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",