-
Notifications
You must be signed in to change notification settings - Fork 8
100 lines (93 loc) · 3.39 KB
/
main.yml
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
91
92
93
94
95
96
97
98
99
100
name: ci
on:
schedule:
# run every midnight (on main)
- cron: '0 0 * * *'
push:
jobs:
# Run tests and publish amd64
build_amd64:
name: Run tests and publish amd64
runs-on: actuated
concurrency:
group: ${{ github.ref }}-amd64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-amd64
- run: make test-integration-ci
- name: Push image to Docker hub only on main or tag (release) but not on schedule
if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule'
run: make docker-push-amd64
# Run tests and publish aarch64
build_aarch64:
name: Run tests and publish aarch64
runs-on: actuated-aarch64
concurrency:
group: ${{ github.ref }}-aarch64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-aarch64
- run: make test-integration-ci
- name: Push image to Docker hub only on main or tag (release) but not on schedule
if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule'
run: make docker-push-aarch64
# publish manifest combining aarch64 and amd64 images
publish_manifest:
name: Build and Publish Manifest to Dockerhub
runs-on: ubuntu-latest
needs: [build_amd64, build_aarch64]
if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-publish-manifest
# build documentation
build_docs:
name: Build docs testrun
runs-on: ubuntu-latest
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make docs-install-requirements
- run: make docs-build
# publish documentation on release
publish-docs:
name: Build and publish docs on tag
needs: [build_docs]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags') && github.event_name != 'schedule'
steps:
- uses: actions/checkout@v3
- uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CUSTOM_DOMAIN: sipi.io
CONFIG_FILE: docs/mkdocs.yml
REQUIREMENTS: docs/requirements.txt