Skip to content

Commit

Permalink
cicd: atualizado workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoSemiOficial committed Sep 21, 2024
1 parent 2b42eb2 commit b3b2304
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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: Front-end | Deploy

on:
# Executa em pushes direcionados ao branch main
push:
branches: ["main"]
# Permite que você execute este fluxo de trabalho manualmente na guia Ações fluxo de trabalho_dispatch:
workflow_dispatch:

# Define permissões do GITHUB_TOKEN para permitir a implantação nas páginas do GitHub
permissions:
contents: read
pages: write
id-token: write

# Permitir apenas uma implantação simultânea, ignorando as execuções na fila entre a execução em andamento e a última na fila.
# No entanto, NÃO cancele execuções em andamento, pois queremos permitir que essas implantações de produção sejam concluídas.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
frontend:
# Define o sistema operacional em que o trabalho será executado
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Acessar o repositório
- uses: actions/checkout@v4
# Instalar e usar a versão 20.9.0 do Node.js
- name: Use Node.js 20.9.0
uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: "npm"
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: frontend

- name: Build
run: npm run build --if-present
working-directory: frontend

- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Carregar repositório inteiro
path: "./frontend/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@
name: Front-end & Back-end | Build & Tests

on:
# Executa em pushes direcionados ao branch main
push:
branches: ["main"]
# Executa em pull request direcionados ao branch main
pull_request:
branches: ["main"]
# Permite que você execute este fluxo de trabalho manualmente na guia Ações fluxo de trabalho_dispatch:
workflow_dispatch:

jobs:
frontend:
# Define o sistema operacional em que o trabalho será executado
runs-on: ubuntu-latest
steps:
# Acessar o repositório
- uses: actions/checkout@v4
# Instalar e usar a versão 20.9.0 do Node.js
- name: Use Node.js 20.9.0
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit b3b2304

Please sign in to comment.