Skip to content

Commit

Permalink
Merge pull request #19 from monotek/automerge
Browse files Browse the repository at this point in the history
update ci
  • Loading branch information
monotek committed Jul 25, 2023
2 parents 71172e7 + 4f0fbd7 commit 60441e2
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 41 deletions.
4 changes: 4 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- match:
dependency_type: all
update_type: "semver:minor"
1 change: 1 addition & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
version: 2

updates:
- package-ecosystem: "docker"
directory: "/"
Expand Down
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧹 Maintenance"
labels:
- "chore"
- "dependencies"
version-resolver:
major:
labels:
- "feature"
minor:
labels:
- "enhancement"
patch:
labels:
- "fix"
- "bugfix"
- "bug"
- "chore"
- "dependencies"
default: patch
template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
22 changes: 0 additions & 22 deletions .github/workflows/build.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: ci

on:
pull_request:

jobs:
super-linter:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Lint Code Base
uses: github/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build
id: docker_build
uses: docker/build-push-action@v4
with:
platforms: linux/amd64
push: false
15 changes: 15 additions & 0 deletions .github/workflows/dependabot-auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: dependabot-auto-merge

on:
pull_request:

jobs:
auto-merge:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE }}
target: minor
23 changes: 23 additions & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-22.04
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 24 additions & 17 deletions .github/workflows/ci-cd.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
name: Push to Registry
---
name: release

on:
push:
branches:
- 'main'
- 'dev'
- main
tags:
- '*'
- "*"

jobs:
docker:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
name: Push Docker Image
runs-on: ubuntu-20.04
docker-build-push:
runs-on: ubuntu-22.04
steps:
- name: Check out source code
- name: Checkout Code
uses: actions/checkout@v3

- 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
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker metadata action
id: meta
uses: docker/metadata-action@v4
with:
images: |
monotek/patroni-selfheal
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha,format=long
- name: Build & Push
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# patroni self heal

Checks patroni status and if state is "start failed" deletes the pod so it can recover on restart.
Checks patroni status and if state is "start failed" deletes the pod so it can recover on restart.

Needed as postgres-operator does no support liveness probe.
Needed as [postgres-operator](https://github.com/zalando/postgres-operator) does no support liveness probe.

The sidecar needs the following additional rbac config (serviceaccount should already exist):

Expand Down

0 comments on commit 60441e2

Please sign in to comment.