Add option to skip tests [skip-tests]
This commit is contained in:
parent
bc99f46720
commit
e504682979
@ -3,6 +3,12 @@
|
|||||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
# 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
|
# 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
|
name: Build Docker and Deploy
|
||||||
run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }}
|
run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }}
|
||||||
|
|
||||||
@ -16,6 +22,9 @@ jobs:
|
|||||||
build_server:
|
build_server:
|
||||||
name: Build Docker Container
|
name: Build Docker Container
|
||||||
runs-on: bfb-cicd-latest
|
runs-on: bfb-cicd-latest
|
||||||
|
if: >-
|
||||||
|
!contains(github.event.head_commit.message, '[skip-ci]') &&
|
||||||
|
!contains(github.event.head_commit.message, '[skip-deployment]')
|
||||||
steps:
|
steps:
|
||||||
- run: echo -n "${{ secrets.DOCKER_REG_PASS }}" | docker login registry.blackforestbytes.com -u docker --password-stdin
|
- run: echo -n "${{ secrets.DOCKER_REG_PASS }}" | docker login registry.blackforestbytes.com -u docker --password-stdin
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
@ -27,6 +36,9 @@ jobs:
|
|||||||
test_server:
|
test_server:
|
||||||
name: Run Unit-Tests
|
name: Run Unit-Tests
|
||||||
runs-on: bfb-cicd-latest
|
runs-on: bfb-cicd-latest
|
||||||
|
if: >-
|
||||||
|
!contains(github.event.head_commit.message, '[skip-ci]') &&
|
||||||
|
!contains(github.event.head_commit.message, '[skip-tests]')
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
@ -68,6 +80,11 @@ jobs:
|
|||||||
name: Deploy to Server
|
name: Deploy to Server
|
||||||
needs: [build_server, test_server]
|
needs: [build_server, test_server]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: >-
|
||||||
|
!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 == 'success'
|
||||||
steps:
|
steps:
|
||||||
- name: Execute deploy on remote (via ssh)
|
- name: Execute deploy on remote (via ssh)
|
||||||
uses: appleboy/ssh-action@v1.0.0
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user