Add option to skip tests [skip-tests]
This commit is contained in:
parent
bc99f46720
commit
14643fc92a
@ -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: ${{ true }}
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user