Skip to content

Commit

Permalink
ci(deploy-allfunctions.yml): adicionar pipeline de deploy geral
Browse files Browse the repository at this point in the history
adicionar pipeline de deploy geral com base nas modificações dos arquivos presentes em functions/lib
  • Loading branch information
NicolasCBV committed Feb 10, 2024
1 parent cf16a09 commit 670043d
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 14 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/deploy-allfunctions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CD - Deploy all functions

on:
push:
branches: ["main"]
paths:
- "functions/lib/**"

jobs:
unit-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
node: [ 16.x, 18.x, 20.x ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run unit tests
run: pnpm run test

deploy:
runs-on: ubuntu-latest
needs: [unit-test]
env:
GOOGLE_APPLICATION_CREDENTIALS: google-application-credentials.json
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Prepare Google Application Credentials
run: |
echo "${{secrets.GOOGLE_APP_CREDENTIALS_BASE64}}" | base64 --decode > "google-application-credentials.json"
- name: Deploy cloud functions
run: gcloud functions deploy DeleteKeyFunc --project ${{secrets.GOOGLE_PROJECT_ID}} --no-allow-unauthenticated --region=southamerica-east1 --trigger-http --runtime=nodejs18 --update-labels=module=signatures --source=.

- name: Remove credentials file
if: success() || failure()
run: |
rm google-application-credentials.json
26 changes: 12 additions & 14 deletions functions/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
export * from "./storages/firestore/index"
export * from "./storages/firestore/repositories/key"
export * from './storages/firestore/index';
export * from './storages/firestore/repositories/key';

export * from "./utils/replace"
export * from "./utils/response"
export * from "./utils/httpHandler"
export * from './utils/replace';
export * from './utils/response';
export * from './utils/httpHandler';

export * from "./entities/key"
export * from './entities/key';
export * from './repositories/key';

export * from "./repositories/key"
export * from './config/logger/contract';
export * from './config/logger/firebaseLogger/adapter';

export * from "./config/logger/contract"
export * from "./config/logger/firebaseLogger/adapter"

export * from "./errors/repositories/key"
export * from "./errors/firestore/index"

export * from "./filters/index"
export * from './errors/repositories/key';
export * from './errors/firestore/index';

export * from './filters/index';

0 comments on commit 670043d

Please sign in to comment.