-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (150 loc) · 4.48 KB
/
build_job.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Build and publish the container image
run-name: ${{ github.actor }} is preparing the next release
"on":
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
tests:
uses: ./.github/workflows/ci_job.yml
docs:
runs-on: ubuntu-latest
needs: tests
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Set up services
run: |
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans
- name: Install dependencies
run: |
python3 -m pip install tox
- name: Creating docs
run: tox -e docs
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
# Upload entire repository
path: './docs/build/html'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
build-and-push-image:
runs-on: ubuntu-latest
needs: tests
permissions:
contents: read
packages: write
steps:
-
name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.X"
-
name: Get tag
id: repository
run: |
echo "repo=$(echo ${{ github.repository }}|tr 'A-Z' 'a-z')" >> $GITHUB_OUTPUT
echo "tag=$(python src/databrowser/__init__.py)" >> $GITHUB_OUTPUT
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push databrowserAPI image
uses: docker/build-push-action@v4
with:
build-args: VERSION=${{steps.repository.outputs.tag}}
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ steps.repository.outputs.repo }}:${{ steps.repository.outputs.tag }}
ghcr.io/${{ steps.repository.outputs.repo }}:latest
bump-databrowser-version:
runs-on: ubuntu-latest
needs: [build-and-push-image, docs]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.X"
- name: Get tag
id: repository
run: |
echo "repo=$(echo ${{ github.repository }}|tr 'A-Z' 'a-z')" >> $GITHUB_OUTPUT
echo "tag=$(python src/databrowser/__init__.py)" >> $GITHUB_OUTPUT
- name: Installing dependencies
run: pip install git-python packaging tomli requests
- name: Getting realease job
run: curl -Ls -o bump.py https://raw.githubusercontent.com/FREVA-CLINT/freva-deployment/versions/release.py
- name: Do the release job
run: python3 bump.py deploy databrowser -b versions -v
env:
GITHUB_TOKEN: ${{secrets.G docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Set up services
run: |
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans
- name: Install dependencies
run: |
python3 -m pip install tox
- name: Creating docs
run: tox -e docs
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
# Upload entire repository
path: './docs/build/html'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html