Skip to content

Commit

Permalink
Merge pull request #28 from zyfra/firebase-mr
Browse files Browse the repository at this point in the history
Firebase mr
  • Loading branch information
ZurabDev authored Feb 1, 2023
2 parents d634e7c + e233ff3 commit 84ad376
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "prizmui"
}
}
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
main:
pr_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -17,11 +17,30 @@ jobs:
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2

- run: npm ci
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- run: npx nx workspace-lint
- run: npx nx format:check --base=origin/main
- run: npx nx clear-cache
- run: npx nx affected --target=test --base=origin/main --parallel --max-parallel=3
- run: npx nx affected --target=lint --base=origin/main --parallel --max-parallel=3
- run: npx nx affected --target=build --base=origin/main --prod --parallel --max-parallel=3
- run: npx nx affected --target=e2e --base=origin/main --prod --parallel --max-parallel=3
- name: 'Build doc app for firebase hosting'
run: npx nx build doc
- name: 'Upload to Firebase HOSTING'
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PRIZMUI }}'
expires: 5d
projectId: prizmui
13 changes: 12 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ jobs:
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- run: npx nx clear-cache
- run: npx nx affected:build --all --prod --parallel --max-parallel=3
- run: cd dist/libs/components && npm publish --verbose || exit_code=0
Expand Down
12 changes: 12 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hosting": {
"public": "dist/apps/doc",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}

0 comments on commit 84ad376

Please sign in to comment.