Skip to content

Commit 53a7352

Browse files
authored
Merge pull request #30 from ufrpe-devs/v2
v2
2 parents a6596ae + 6f5fc86 commit 53a7352

55 files changed

Lines changed: 19185 additions & 31467 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/check-gatsbyjs.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 29 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,43 @@
1-
name: Deploy
1+
name: Site deploy
22

3-
on:
4-
milestone:
5-
types: [ closed ]
6-
7-
workflow_dispatch:
3+
on:
4+
workflow_run:
5+
workflows:
6+
- 'Publish'
7+
branches:
8+
- 'main'
9+
types:
10+
- completed
811

912
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-
5613
deploy:
57-
runs-on: ubuntu-20.04
58-
needs: [validate, build]
59-
concurrency:
60-
group: ${{ github.workflow }}-${{ github.ref }}
14+
name: Deploy
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
runs-on: ubuntu-latest
6117
steps:
62-
- uses: actions/checkout@v2
63-
64-
- name: Setup Node
65-
uses: actions/setup-node@v2
18+
- name: Checkout
19+
uses: actions/checkout@v3
6620
with:
67-
node-version: '14'
68-
69-
- name: Cache dependencies
70-
uses: actions/cache@v2
21+
fetch-depth: 0
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v3
7125
with:
72-
path: ~/.npm
73-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
74-
restore-keys: |
75-
${{ runner.os }}-node-
26+
node-version: '16'
27+
cache: 'npm'
28+
29+
- name: Install Dependencies
30+
working-directory: .
31+
run: npm ci
7632

7733
- name: Build
78-
run: |
79-
npm ci
80-
npm run build
34+
working-directory: .
35+
run: npm run build
8136

82-
- name: Deploy
37+
- name: Deploy to GitHub Pages
8338
uses: peaceiris/actions-gh-pages@v3
84-
if: ${{ github.ref == 'refs/heads/main' }}
8539
with:
8640
github_token: ${{ secrets.GITHUB_TOKEN }}
87-
publish_dir: ./public
41+
publish_dir: ./build
8842
user_name: 'ufrpedevs'
89-
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 }}
43+
user_email: 'ufrpedevs@gmail.com'

.github/workflows/publish.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump_type:
7+
description: 'Bump type'
8+
required: true
9+
default: 'minor'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
bump:
18+
name: Release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: '16'
30+
cache: 'npm'
31+
32+
- name: Install Dependencies
33+
run: npm ci
34+
35+
- name: ReleaseIt
36+
run: npm run release
37+
38+
release:
39+
name: Publish
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v3
44+
with:
45+
fetch-depth: 0
46+
47+
- name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: '16'
51+
cache: 'npm'
52+
53+
- name: Install Dependencies
54+
run: npm ci
55+
56+
- name: Build Changelog
57+
id: github_release_build
58+
uses: mikepenz/release-changelog-builder-action@v2.4.3
59+
with:
60+
configuration: "./.github/workflows/changelog-config.json"
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Read version
65+
id: app_version
66+
run: >-
67+
echo "::set-output name=VERSION::$(
68+
npm pkg get version |
69+
sed 's/"//g'
70+
)"
71+
72+
- name: Create GitHub Release
73+
uses: softprops/action-gh-release@v1
74+
with:
75+
tag_name: v${{ steps.app_version.outputs.VERSION }}
76+
release_name: v${{ steps.app_version.outputs.VERSION }}
77+
body: ${{ steps.github_release_build.outputs.changelog }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Validate
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- 'main'
8+
pull_request:
9+
branches:
10+
- 'main'
11+
12+
jobs:
13+
validate:
14+
name: Check code
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '16'
24+
cache: 'npm'
25+
26+
- name: Install
27+
run: npm ci
28+
29+
- name: Format
30+
run: npm run format:check
31+
32+
check_build:
33+
name: Check Build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
39+
- name: Setup Node
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: '16'
43+
cache: 'npm'
44+
45+
- name: Install
46+
run: npm ci
47+
48+
- name: Build
49+
run: npm run build

0 commit comments

Comments
 (0)