-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.66 KB
/
deploy.yml
File metadata and controls
71 lines (59 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy to GitHub Pages (CD)
on:
# Executa em push para a branch main e também manualmente
push:
branches: [main]
workflow_dispatch:
inputs:
deploy_coverage:
description: 'Publish coverage report'
type: boolean
default: true
permissions:
contents: write
jobs:
deploy-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install and Build
run: |
npm ci
npm run build
- name: Create .nojekyll
run: touch dist/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: gh-pages
clean-exclude: coverage/**
commit-message: "Deploy application [skip ci]"
deploy-coverage:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.deploy_coverage == 'true' }}
needs: deploy-app
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Run Unit Tests with Coverage
run: npm run test:coverage
- name: Deploy Coverage Report
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: coverage/
branch: gh-pages
target-folder: coverage
clean: false
commit-message: "Deploy coverage report [skip ci]"