-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d6f3b2
commit b4634ed
Showing
4 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: docker-build | ||
|
||
on: | ||
schedule: | ||
- cron: "0 10 * * *" | ||
push: | ||
branches: | ||
- "**" | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
geokrety/basex-amqp-sync | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=sha | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push - base | ||
uses: docker/build-push-action@v4 | ||
with: | ||
file: Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
|
||
- uses: pre-commit/action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: Semantic release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ssh-key: "${{ secrets.COMMIT_KEY }}" | ||
|
||
# setting up Node | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
# disable package-lock.json to stop it being created | ||
- name: Disable package-lock.json | ||
run: npm config set package-lock false | ||
|
||
# Installing package dependencies | ||
- name: Install dependencies | ||
run: | | ||
npm i -D [email protected] conventional-changelog-conventionalcommits semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/exec @semantic-release/changelog @semantic-release/github @semantic-release/git | ||
- name: New tag | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GIT_AUTHOR_NAME: geokrety-bot | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: geokrety-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
run: | | ||
cat > .releaserc.json <<EOF | ||
{ | ||
"branches": ["semver", "main", "master"], | ||
"debug": "true", | ||
"plugins": [ | ||
["@semantic-release/commit-analyzer",{ | ||
"preset": "angular", | ||
"releaseRules": [ | ||
{"breaking": true, "release": "major"}, | ||
{"type": "feat", "release": "minor"}, | ||
{"type": "fix", "release": "patch"}, | ||
{"type": "docs", "release": false}, | ||
{"type": "style", "release": "patch"}, | ||
{"type": "refactor", "release": "patch"}, | ||
{"type": "perf", "release": "patch"}, | ||
{"type": "test", "release": false}, | ||
{"type": "chore", "release": "patch"}, | ||
{"type": "dependencies", "release": "patch"}, | ||
{"type": "revert", "release": "patch"}, | ||
{"type": "translation", "release": "patch"}, | ||
{"type": "ci", "release": "patch"} | ||
], | ||
"parserOpts": { | ||
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"] | ||
} | ||
}], | ||
["@semantic-release/release-notes-generator",{ | ||
"preset": "conventionalCommits", | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES" | ||
] | ||
}, | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "Performance Improvements" | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "Reverts" | ||
}, | ||
{ | ||
"type": "translation", | ||
"section": "Translations" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "Code Refactoring" | ||
}, | ||
{ | ||
"type": "style", | ||
"section": "Style" | ||
}, | ||
{ | ||
"type": "dependencies", | ||
"section": "Dependencies", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Chores", | ||
"hidden": false | ||
} | ||
] | ||
} | ||
}], | ||
"@semantic-release/changelog", | ||
"@semantic-release/github" | ||
] | ||
} | ||
EOF | ||
npx [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
exclude: | | ||
(?x)( | ||
^vendor/ | ||
) | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.1.9 | ||
hooks: | ||
- id: remove-crlf |