Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pr #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions .github/workflows/github-actions-demo.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,73 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: CI

on:
push:
branches: [ "add-materiais-aula", "main"]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

# executar comandos em um subdiretório
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./exercicios/para-sala/users-api-aula

# configuração do ambiente de execução do projeto Node.js
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
# clone do repositório
- name: checkout
uses: actions/checkout@v4

# pega a versão declarada do Node.j e configura no ambiente virtual
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# instala dependencias e roda os testes
- run: npm ci
- run: npm run build --if-present
- run: npm test

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# lint para garantir que o código segue os padrões definidos
- name: Run ESLint
run: npm run lint

# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# verificação de vulnerabilidades em pacotes
- name: Run security audit
run: npm audit

# conferir se tem erros de tipagem
- name: TypeScript Check
run: npx tsc --noEmit

# setamos o Docker Buildx no ambiente onde o job está sendo executado.
# Permite construir imagens Docker para várias arquiteturas
- name: Set up Docker Buildx
if: github.ref == 'refs/heads/main'
uses: docker/setup-buildx-action@v3

# faz login no docker hub
- name: Log in to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
- name: Build and push
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v4
with:
context: ./exercicios/para-sala/users-api-aula
context: exercicios/para-sala/users-api-aula
push: true
tags: raissabrizeno/users-api-aula:1.0.0

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Turma Online ON32 - Metodologia DevOps | Semana 10 | 2024 | Professora Raissa Br
Sou formada em Bacharelado de Sistemas de infromação pela UFRPE, trabalho com DevOps há mais de seis anos e hoje trabalho como Engenheira de plataforma no Picpay.

- 💌 Email: [email protected]
- 💼 LinkedIn: [in/raissabrizeno](https://www.linkedin.com/in/raissa-brizeno/)
- 💼 LinkedIn: [in/raissabrizeno](https://www.linkedin.com/in/raissa-brizeno/)\

####TESTE


### Instruções
Expand Down
Loading