Add option to skip tests [skip-tests]
All checks were successful
Build Docker and Deploy / Run Unit-Tests (push) Has been skipped
Build Docker and Deploy / Build Docker Container (push) Successful in 44s
Build Docker and Deploy / Deploy to Server (push) Successful in 12s

This commit is contained in:
Mike Schwörer 2025-04-12 21:27:40 +02:00
parent bc99f46720
commit 86b8c47ed5
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -3,6 +3,12 @@
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# Configurable with a few commit messages:
# - [skip-tests] Skip the test stage
# - [skip-deployment] Skip the deployment stage
# - [skip-ci] Skip all stages (the whole ci/cd)
#
name: Build Docker and Deploy
run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }}
@ -16,6 +22,9 @@ jobs:
build_server:
name: Build Docker Container
runs-on: bfb-cicd-latest
if: >-
!contains(github.event.head_commit.message, '[skip-ci]') &&
!contains(github.event.head_commit.message, '[skip-deployment]')
steps:
- run: echo -n "${{ secrets.DOCKER_REG_PASS }}" | docker login registry.blackforestbytes.com -u docker --password-stdin
- name: Check out code
@ -27,6 +36,9 @@ jobs:
test_server:
name: Run Unit-Tests
runs-on: bfb-cicd-latest
if: >-
!contains(github.event.head_commit.message, '[skip-ci]') &&
!contains(github.event.head_commit.message, '[skip-tests]')
steps:
- name: Check out code
@ -68,6 +80,12 @@ jobs:
name: Deploy to Server
needs: [build_server, test_server]
runs-on: ubuntu-latest
if: >-
!cancelled() &&
!contains(github.event.head_commit.message, '[skip-ci]') &&
!contains(github.event.head_commit.message, '[skip-deployment]') &&
needs.build_server.result == 'success' &&
(needs.test_server.result == 'skipped' || needs.test_server.result == 'success')
steps:
- name: Execute deploy on remote (via ssh)
uses: appleboy/ssh-action@v1.0.0