Compare commits

...

2 Commits

Author SHA1 Message Date
bretello 3955481e32
ci: add failure notification 2024-01-08 13:03:46 +01:00
bretello 471fc948a8
ci: switch to github actions 2024-01-08 09:52:17 +01:00
2 changed files with 40 additions and 32 deletions

View File

@ -0,0 +1,40 @@
name: Build Image
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "20 4 * * 6" # saturday at 4.20
workflow_dispatch:
env:
FORCE_COLOR: "1"
DOCKER_REGISTRY: registry.decapod.one
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to docker registry
uses: docker/login-action@v3
with:
registry: registry.decapod.one
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: registry.decapod.one/brethil/dotfiles:latest
- name: Notify on failure
if: failure()
run: python -m venv .
pip install https://git.decapod.one/brethil/bretellofier
./bin/bretellofier "[brethil/dotfiles] 💥 Build failed"
env:
BRETELLOFIER_RECIPIENTS: ${{ secrets.BRETELLOFIER_RECIPIENTS }}
BRETELLOFIER_TOKEN: ${{ secrets.BRETELLOFIER_TOKEN}}

View File

@ -1,32 +0,0 @@
when:
- event: push
branch: master
steps:
build:
name: build docker image
image: woodpeckerci/plugin-docker-buildx
settings:
repo: registry.decapod.one/brethil/dotfiles
registry: registry.decapod.one
auto_tag: true
username:
from_secret: registry_user
password:
from_secret: registry_token
notify:
image: registry.decapod.one/toolchain:latest
secrets: [bretellofier_token, bretellofier_recipients]
commands:
- bretellofier "[woodpecker] ✅ Succesfully built ${CI_REPO}"
when:
- status: [success]
notify-on-failure:
image: registry.decapod.one/toolchain
secrets: [bretellofier_token, bretellofier_recipients]
when:
- status: [failure]
commands:
- bretellofier "[woodpecker] 💥 $CI_REPO CI failed"