Skip to content

Commit

Permalink
ci: trocar branch da action
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeLNJunior committed Mar 4, 2024
1 parent 3423aef commit 75aedc4
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 126 deletions.
139 changes: 69 additions & 70 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,85 @@ on:
workflow_call:

jobs:
build:
name: 🔨 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install
- run: pnpm build:backend
# build:
# name: 🔨 Build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - run: pnpm install
# - run: pnpm build:backend

test:
name: 🧪 Tests
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- name: Setup MySQL 8
uses: mirromutth/[email protected]
with:
mysql version: '8.0'
mysql database: 'game_deal_test'
mysql root password: 'root'
- name: Setup Redis 7
uses: supercharge/[email protected]
with:
redis-version: 7
- run: pnpm install
- run: pnpm test:backend:cov
env:
test: true
- name: coverage
uses: actions/upload-artifact@v4
with:
name: backend_coverage
path: apps/backend/coverage/
if-no-files-found: error
# test:
# name: 🧪 Tests
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - name: Setup MySQL 8
# uses: mirromutth/[email protected]
# with:
# mysql version: '8.0'
# mysql database: 'game_deal_test'
# mysql root password: 'root'
# - name: Setup Redis 7
# uses: supercharge/[email protected]
# with:
# redis-version: 7
# - run: pnpm install
# - run: pnpm test:backend:cov
# env:
# test: true
# - name: coverage
# uses: actions/upload-artifact@v4
# with:
# name: backend_coverage
# path: apps/backend/coverage/
# if-no-files-found: error

lint:
name: 🧹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:backend
# lint:
# name: 🧹 Lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - run: pnpm install
# - run: pnpm lint:backend

openapi:
name: 🧪 Validate OpenAPI File
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: validate OpenAPI definition
uses: char0n/swagger-editor-validate@v1
with:
definition-file: ./apps/backend/src/modules/api/docs/swagger.yaml
# openapi:
# name: 🧪 Validate OpenAPI File
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: validate OpenAPI definition
# uses: char0n/swagger-editor-validate@v1
# with:
# definition-file: ./apps/backend/src/modules/api/docs/swagger.yaml

deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
needs: [test, lint, openapi]
if: github.ref == 'refs/heads/main'
# needs: [test, lint, openapi]
permissions:
deployments: write
steps:
- uses: JorgeLNJunior/render-deploy@v1.4.4
- uses: JorgeLNJunior/render-deploy@deps
with:
service_id: ${{ secrets.BACKEND_RENDER_SERVICE_ID }}
api_key: ${{ secrets.RENDER_API_KEY }}
Expand Down
112 changes: 56 additions & 56 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,71 @@ on:
workflow_call:

jobs:
build:
name: 🔨 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install
- run: pnpm build:frontend
- uses: actions/upload-artifact@v4
with:
name: build
path: apps/frontend/dist
if-no-files-found: error
# build:
# name: 🔨 Build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - run: pnpm install
# - run: pnpm build:frontend
# - uses: actions/upload-artifact@v4
# with:
# name: build
# path: apps/frontend/dist
# if-no-files-found: error

test:
name: 🧪 Tests
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install
- run: pnpm test:frontend:cov
env:
test: true
- name: coverage
uses: actions/upload-artifact@v4
with:
name: frontend_coverage
path: apps/frontend/coverage/
if-no-files-found: error
# test:
# name: 🧪 Tests
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - run: pnpm install
# - run: pnpm test:frontend:cov
# env:
# test: true
# - name: coverage
# uses: actions/upload-artifact@v4
# with:
# name: frontend_coverage
# path: apps/frontend/coverage/
# if-no-files-found: error

lint:
name: 🧹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint:frontend
# lint:
# name: 🧹 Lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v3
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: '20.x'
# cache: 'pnpm'
# - run: pnpm install
# - run: pnpm lint:frontend

deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
needs: [test, lint]
if: github.ref == 'refs/heads/main'
# needs: [test, lint]
# if: github.ref == 'refs/heads/main'
permissions:
deployments: write
steps:
- uses: JorgeLNJunior/render-deploy@v1.4.4
- uses: JorgeLNJunior/render-deploy@v1
with:
service_id: ${{ secrets.FRONTEND_RENDER_SERVICE_ID }}
api_key: ${{ secrets.RENDER_API_KEY }}
Expand Down

0 comments on commit 75aedc4

Please sign in to comment.