Skip to content

Commit a6596ae

Browse files
authored
[CI/CD] Pipeline do projeto
Merge pull request #26 from SteffanoP/main
2 parents 7095058 + aa18013 commit a6596ae

11 files changed

Lines changed: 364 additions & 67 deletions

File tree

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended"
9+
],
10+
"parserOptions": {
11+
"ecmaFeatures": {
12+
"jsx": true
13+
},
14+
"ecmaVersion": 12,
15+
"sourceType": "module"
16+
},
17+
"plugins": [
18+
"react"
19+
],
20+
"rules": {
21+
}
22+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🚀 O que há de novo?",
5+
"labels": [
6+
"feature"
7+
]
8+
},
9+
{
10+
"title": "## 🐛 Fixes",
11+
"labels": [
12+
"fix"
13+
]
14+
},
15+
{
16+
"title": "## 📝 Conteúdo",
17+
"labels": [
18+
"content"
19+
]
20+
},
21+
{
22+
"title": "## 🧰 Manutenção",
23+
"labels": [
24+
"chore",
25+
"style"
26+
]
27+
}
28+
],
29+
"ignore_labels": [
30+
"ignore"
31+
],
32+
"sort": "ASC",
33+
"pr_template": "- ${{TITLE}}\n por @${{AUTHOR}} em #{{NUMBER}}",
34+
"base_branches": [
35+
"main"
36+
]
37+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Check Gatsbyjs
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
check-lint:
9+
runs-on: ubuntu-20.04
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '14'
18+
19+
- name: Cache dependencies
20+
uses: actions/cache@v2
21+
with:
22+
path: ~/.npm
23+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-node-
26+
27+
- name: Install modules
28+
run: npm ci
29+
30+
- name: Run ESLint
31+
run: npm run lint
32+
33+
check-prettier:
34+
runs-on: ubuntu-20.04
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: '14'
44+
45+
- name: Install prettier
46+
run: npm install --save-dev --save-exact prettier
47+
48+
- name: Run Prettier check
49+
run: npx prettier --check **/*.{js,jsx,md}
50+
51+
build:
52+
runs-on: ubuntu-20.04
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v2
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v2
60+
with:
61+
node-version: '14'
62+
63+
- name: Install Modules
64+
run: npm ci
65+
66+
- name: Build
67+
run: npm run build

.github/workflows/deploy.yml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,61 @@
1-
name: GitHub Pages
1+
name: Deploy
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
4+
milestone:
5+
types: [ closed ]
6+
97
workflow_dispatch:
108

119
jobs:
10+
validate:
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '14'
20+
21+
- name: Cache dependencies
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-node-
28+
29+
- name: Install modules
30+
run: npm ci
31+
32+
- name: Check ESLint
33+
run: npm run lint
34+
35+
- name: Check Prettier
36+
run: npx prettier --check **/*.{js,jsx,md}
37+
38+
build:
39+
runs-on: ubuntu-20.04
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v2
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v2
47+
with:
48+
node-version: '14'
49+
50+
- name: Install Modules
51+
run: npm ci
52+
53+
- name: Build
54+
run: npm run build
55+
1256
deploy:
1357
runs-on: ubuntu-20.04
58+
needs: [validate, build]
1459
concurrency:
1560
group: ${{ github.workflow }}-${{ github.ref }}
1661
steps:
@@ -42,3 +87,31 @@ jobs:
4287
publish_dir: ./public
4388
user_name: 'ufrpedevs'
4489
user_email: 'ufrpedevs@gmail.com'
90+
91+
release:
92+
runs-on: ubuntu-20.04
93+
needs: deploy
94+
if: github.event_name == 'milestone'
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v2
98+
with:
99+
fetch-depth: 100
100+
101+
- name: Build Changelog
102+
id: github_release_build
103+
uses: mikepenz/release-changelog-builder-action@v2.4.3
104+
with:
105+
configuration: "./.github/workflows/changelog-config.json"
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
109+
- name: Create GitHub Release
110+
uses: actions/create-release@v1
111+
with:
112+
tag_name: ${{ github.event.milestone.title }}
113+
release_name: ${{ github.event.milestone.title }}
114+
body: ${{ steps.github_release_build.outputs.changelog }}
115+
draft: true #That is temporary, may be removed after test
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
_Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.com/tutorial/part-five/#introducing-graphiql)._
2525
26-
2726
## 🧐 What's inside?
2827

2928
A quick look at the top-level files and directories you'll see in a Gatsby project.
@@ -73,4 +72,3 @@ Looking for more guidance? Full documentation for Gatsby lives [on the website](
7372
- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.com/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.
7473
7574
- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.com/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar.
76-

gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-undef */
12
require("dotenv").config({
23
path: `.env.${process.env.NODE_ENV}`,
34
});

0 commit comments

Comments
 (0)