-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add function deploy actions
- Loading branch information
Showing
41 changed files
with
487 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
name: E2E Firebase Live Hosting on Merge | ||
'on': | ||
name: Deploy Firebase Function|Hosting on Merge | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy_firebase_function_and_hosting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
# needed for all cases | ||
- if: github.event_name == 'push' && github.ref_name == 'main' | ||
uses: actions/checkout@v3 | ||
# needed for nx affected command | ||
- if: github.event_name == 'pull_request' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
# needed for nx affected command | ||
- if: github.event_name == 'pull_request' | ||
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
|
@@ -20,28 +28,23 @@ jobs: | |
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Production build (client + prerender + server) | ||
run: npm run nx run firebase-function:build:production | ||
|
||
- name: Deploy firebase live hosting | ||
- name: Deploy firebase function|hosting | ||
id: deployStep | ||
# We can not use the firebase github action as it throws because of "channelID requires" | ||
# Notes: in package.json there is a hack (`|| true`) in the prepare script to make it pass (`"prepare": "husky install || true"`). | ||
# Since we don't upload the node_modules. The real reason dough is we don't put a custom `package.json` in the dist folder. | ||
# We can not use the firebase GitHub action as it throws because of "channelID requires" | ||
run: | | ||
npm run nx run firebase-function:deploy | ||
npm run nx affected -- --targets=deploy-firebase --no-parallel | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
|
||
- name: Run user flow against firebase live hosting | ||
run: npm run nx run movies:user-flow:production -- --format=md --url=https://angular-movies-a12d3.web.app | ||
|
||
- name: Collect user flows | ||
id: firebase-live-hosting | ||
id: test-firebase-function--deploy-live | ||
uses: push-based/[email protected] | ||
with: | ||
verbose: on | ||
commentId: firebase-live-hosting | ||
commentId: test-firebase-function--deploy-live | ||
onlyComments: on | ||
outPath: ./dist/user-flow/movies | ||
rcPath: ./projects/movies/.user-flowrc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: E2E Firebase Function on PR | ||
'on': pull_request | ||
on: pull_request | ||
jobs: | ||
emulate_firebase_function_and_test: | ||
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' | ||
|
@@ -28,7 +28,7 @@ jobs: | |
uses: push-based/[email protected] | ||
with: | ||
verbose: on | ||
commentId: firebase-function-emulation | ||
commentId: test-firebase-function--deploy-emulation | ||
onlyComments: on | ||
outPath: ./dist/user-flow/firebase-function | ||
rcPath: projects/firebase-function/.user-flowrc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"emulators": { | ||
"functions": { | ||
"port": 4402 | ||
} | ||
}, | ||
"functions": { | ||
"source": ".", | ||
"ignore": [ | ||
" **/.*", | ||
"**/node_modules/**", | ||
"**/tmp/**", | ||
"**/tooling/**", | ||
"**/LICENSE", | ||
"**/CONTRIBUTING.md", | ||
"**/README.md", | ||
"**/commitlint.config.js", | ||
"**/database.rules.json", | ||
"**/firebase-debug.log", | ||
"**/firebase.function.json", | ||
"**/firebase.json", | ||
"**/jest.config.ts", | ||
"**/jest.preset.js", | ||
"**/migrations.json", | ||
"**/nx.json", | ||
"**/tsconfig.json", | ||
"**/ui-debug.log", | ||
"**/wrangler.toml" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.