CI/CD #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Checks the code logic, style and more | |
# -*- coding: utf-8 -*- | |
# Copyright (C) 2023 Benjamin Thomas Schwertfeger | |
# GitHub: https://github.com/btschwertfeger | |
# | |
# Workflow to apply pre-commit, build, test and upload the docker | |
# image(s). | |
name: CI/CD | |
on: | |
push: | |
branches: | |
- "**" | |
schedule: | |
- cron: "20 16 * * 0" | |
release: | |
types: [created] | |
concurrency: | |
group: CICD-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
## Run the pre-commit content | |
Pre-Commit: | |
uses: ./.github/workflows/_pre_commit.yaml | |
## Build the BiasAdjustCXX command-line tool | |
## | |
Build: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_build.yaml | |
## Build the documentation | |
## | |
Build-Doc: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_build_doc.yaml | |
with: | |
os: "ubuntu-latest" | |
python-version: "3.11" | |
## Build the test suite and run the unit tests | |
## | |
Test: | |
needs: [Pre-Commit] | |
uses: ./.github/workflows/_test.yaml | |
## Create and upload a docker image | |
## | |
Docker: | |
if: success() && github.event_name == 'push' | |
needs: [Build, Test] | |
uses: ./.github/workflows/_build_docker.yaml | |
with: | |
TAG: ${{ github.ref_name }} | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
## Create and upload the tagged docker image | |
## | |
Docker-tag: | |
if: | | |
success() && | |
github.actor == 'btschwertfeger' && | |
github.event_name == 'release' | |
needs: [Build, Test] | |
uses: ./.github/workflows/_build_docker.yaml | |
with: | |
TAG: ${{ github.ref_name }} | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
## Create and upload the latest docker image | |
## | |
Docker-latest: | |
if: | | |
success() && | |
github.actor == 'btschwertfeger' && | |
github.event_name == 'release' | |
needs: [Build, Test] | |
uses: ./.github/workflows/_build_docker.yaml | |
with: | |
TAG: latest | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |