Add option to skip tests [skip-tests]
Some checks failed
Build Docker and Deploy / Run Unit-Tests (push) Has been skipped
Build Docker and Deploy / Build Docker Container (push) Successful in 5s
Build Docker and Deploy / Deploy to Server (push) Failing after 10s

This commit is contained in:
Mike Schwörer 2025-04-12 21:27:40 +02:00
parent bc99f46720
commit 9a625396cd
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,17 +22,23 @@ 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
uses: actions/checkout@v3
- run: cd "${{ gitea.workspace }}/scnserver" && make clean
- run: cd "${{ gitea.workspace }}/scnserver" && make docker
- run: cd "${{ gitea.workspace }}/scnserver" && make push-docker
# - run: cd "${{ gitea.workspace }}/scnserver" && make clean
# - run: cd "${{ gitea.workspace }}/scnserver" && make docker
# - run: cd "${{ gitea.workspace }}/scnserver" && make push-docker
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,7 +80,17 @@ jobs:
name: Deploy to Server
needs: [build_server, test_server]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: This job runs only on pull requests
run: echo "JOB name conditional-job"
- name: check result
run: |
echo 'needs.skip-job.result'
echo 'needs.deploy.result'
- name: Execute deploy on remote (via ssh)
uses: appleboy/ssh-action@v1.0.0
with: