Skip to content

Commit

Permalink
ci(workflows): corrigindo erro de paralelismo entre os workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCBV committed Feb 10, 2024
1 parent ff939a3 commit ecaf4c6
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 106 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/deploy-createkeyfunc.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/deploy-functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CD - Deploy CreateKeyFunc function

on:
push:
branches: ["main"]
paths:
- ".github/workflows/deploy-functions.yml"
- "functions/createKeyFunc/**"
- "functions/updateKeyFunc/**"
- "functions/lib/**"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
id: git-clone
name: Cloning repository

- uses: dorny/paths-filter@v3
id: path-filter
with:
base: ${{ github.ref }}
filters: |
workflow:
- ".github/workflows/deploy-functions.yml"
createfunc:
- "functions/createKeyFunc/**"
updatefunc:
- "functions/updateKeyFunc/**"
lib:
- "functions/lib/**"
- name: Google auth
uses: google-github-actions/auth@v1
id: gcp-auth
if: steps.changes.outputs.createfunc == 'true' || steps.changes.outputs.lib == 'true' || steps.changes.workflow == 'true'
with:
credentials_json: '${{ secrets.GOOGLE_APP_CREDENTIALS_BASE64 }}'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
id: set-gcloud
if: steps.changes.outputs.createfunc == 'true' || steps.changes.outputs.lib == 'true' || steps.changes.workflow == 'true'
with:
project_id: '${{ secrets.GOOGLE_PROJECT_ID }}'

- name: Deploy cloud create key function
id: deploy-create-key-func
if: steps.changes.outputs.createfunc == 'true' || steps.changes.outputs.lib == 'true' || steps.changes.workflow == 'true'
run: |
gcloud functions deploy CreateKeyFunc \
--project ${{ secrets.GOOGLE_PROJECT_ID }} \
--no-allow-unauthenticated \
--region=${{ secrets.REGION }} \
--trigger-http \
--runtime=${{ secrets.RUNTIME }} \
--update-labels=module=signatures \
--source=.
- name: Deploy cloud update key function
id: deploy-update-key-func
if: steps.changes.outputs.updatefunc == 'true' || steps.changes.outputs.lib == 'true' || steps.changes.workflow == 'true'
run: |
gcloud functions deploy UpdateKeyFunc \
--project ${{ secrets.GOOGLE_PROJECT_ID }} \
--no-allow-unauthenticated \
--region=${{ secrets.REGION }} \
--trigger-http \
--runtime=${{ secrets.RUNTIME }} \
--update-labels=module=signatures \
--source=.
53 changes: 0 additions & 53 deletions .github/workflows/deploy-updatekeyfunc.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,26 @@ jobs:
node: [ 16.x, 18.x, 20.x ]
steps:
- uses: actions/checkout@v3
id: git-clone
name: Cloning repository

- uses: pnpm/action-setup@v2
id: install-pnpm
name: Installing PNPM
with:
version: 8

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

- name: Install dependencies
id: set-deps
run: pnpm install --frozen-lockfile

- name: Run unit tests
id: unit-tests
run: pnpm run test

0 comments on commit ecaf4c6

Please sign in to comment.