Skip to content

Commit 78296e1

Browse files
committed
Initial commit
0 parents  commit 78296e1

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Docker Build & Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*.*.*"
9+
10+
jobs:
11+
build-and-push:
12+
name: Build & Push Docker Image
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- uses: docker/login-action@v3
23+
with:
24+
username: ${{ github.repository_owner }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+
- name: Build and push latest (main branch only)
28+
if: github.ref == 'refs/heads/main'
29+
uses: docker/build-push-action@v6
30+
with:
31+
context: .
32+
platforms: &platforms linux/amd64,linux/arm64
33+
push: true
34+
tags: ${{ github.repository }}:latest
35+
36+
- name: Build and push semver tag (tags only)
37+
if: startsWith(github.ref, 'refs/tags/v')
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: .
41+
platforms: *platforms
42+
push: true
43+
tags: ${{ github.repository }}:${{ github.ref_name }}

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM codemowers/ci
2+
ADD gitlint.ini /config/gitlint.ini
3+
ENTRYPOINT ["gitlint", "--config", "/config/gitlint.ini"]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Gitlint
2+
3+
This is what we use in the CI/CD pipelines, to run locally use:
4+
5+
```
6+
docker run -it --rm --user $UID -v $PWD:/workspace codemowers/gitlint
7+
```
8+
9+
General tips on how to format commit messages https://github.com/knowbl/git-commit-message#the-seven-rules

gitlint.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[general]
2+
ignore=body-is-missing
3+
ignore-stdin=true
4+
5+
[title-match-regex]
6+
# Commit title is a sentence and it starts with capital letter
7+
regex=[A-Z]
8+
9+
[author-valid-email]
10+
# Must use username@codemowers.io for commits
11+
#regex=[^@]+@codemowers.io
12+
13+
[title-must-not-contain-word]
14+
# Use imperative mood for commit title
15+
words=adding,added,enabling,enabled,disabling,disabled,updating,updated,bumping,bumped,making,refactoring,refactored,starting,started

0 commit comments

Comments
 (0)