Skip to content

Commit 3420731

Browse files
authored
Merge pull request #3 from fabidick22/add-semver-workflow
Add CI/CD workflows
2 parents 71dd0b8 + 7fbb13d commit 3420731

File tree

4 files changed

+89
-2
lines changed

4 files changed

+89
-2
lines changed

.github/workflows/cd-semver.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Continuous Delivery
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
if: contains(github.event.commits[0].message, 'chore(release)') == false
11+
name: Release
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
env:
15+
DRY_RUN: false
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
22+
23+
- name: Release
24+
id: release
25+
uses: ridedott/release-me-action@v3
26+
env:
27+
GITHUB_TOKEN: ${{ github.token }}
28+
with:
29+
dry-run: ${{ env.DRY_RUN }}
30+
release-branches: '["main"]'
31+
commit-assets: |
32+
./dist
33+
release-rules-append: |
34+
[
35+
{ "release": "patch", "type": "build" },
36+
{ "release": "patch", "type": "chore" },
37+
{ "release": false, "type": "chore", "scope": "deps-dev" },
38+
{ "release": "patch", "type": "chore", "scope": "deps-dev", "subject": "bump @zeit/ncc from*" },
39+
{ "release": "patch", "type": "ci" },
40+
{ "release": "patch", "type": "improvement" },
41+
{ "release": "patch", "type": "refactor" },
42+
{ "release": false, "subject": "*\\[skip release\\]*" }
43+
]
44+
45+
- uses: actions/checkout@v3
46+
if: steps.release.outputs.released == 'true' && env.DRY_RUN == 'false'
47+
with:
48+
fetch-depth: 1
49+
persist-credentials: true
50+
51+
- name: Tag
52+
if: steps.release.outputs.released == 'true' && env.DRY_RUN == 'false'
53+
run: |
54+
git push origin :refs/tags/'v${{ steps.release.outputs.major }}'
55+
git tag 'v${{ steps.release.outputs.major }}' --force
56+
git push --tags

.github/workflows/ci-docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Update Documentation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- 'action.yml'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- run: npm install -g action-docs
17+
18+
- run: action-docs -u
19+
20+
- name: Update README.md file
21+
uses: test-room-7/action-update-file@v1
22+
if: github.event_name == 'pull_request'
23+
with:
24+
file-path: README.md
25+
commit-msg: 'docs: Update github actions documentation [skip release]'
26+
github-token: ${{ github.token }}
27+
branch: ${{ github.head_ref }}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ jobs:
5757

5858
| parameter | description |
5959
| - | - |
60-
| paths_changed | List of changed paths, example: ``` ["dist", "dist/data"] ```
60+
| paths_changed | List of changed paths, example:
61+
``` ["dist", "dist/data"] ```
6162
|
62-
| file_changed | List of changed files, example: ``` ["dist/main.tf", "dist/index.js"] ```
63+
| file_changed | List of changed files, example:
64+
``` ["dist/main.tf", "dist/index.js"] ```
6365
|
6466

6567

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ outputs:
1313
paths_changed:
1414
description: >
1515
List of changed paths, example:
16+
1617
```
1718
["dist", "dist/data"]
1819
```
1920
file_changed:
2021
description: >
2122
List of changed files, example:
23+
2224
```
2325
["dist/main.tf", "dist/index.js"]
2426
```

0 commit comments

Comments
 (0)