-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (80 loc) · 2.11 KB
/
cicd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## 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 }}