Repository navigation
71 lines (56 loc) · 1.92 KB
/
Copy pathdocker-build.yml
File metadata and controls
71 lines (56 loc) · 1.92 KB
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
name: ubuntu-24.04
on:
push:
branches: [master]
tags:
- v*.*.*
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout the repository
uses: actions/checkout@v7
- name: Build the Docker image
run: docker build . --file Dockerfile --tag mycpp_image:latest
- name: Verify the toolchain in the image
run: docker run --rm mycpp_image:latest sh -c "cmake --version && ninja --version && doxygen --version"
- name: Configure CMake
run: docker run --rm -v "${{ github.workspace }}:/cpp_tutorials" mycpp_image:latest cmake --preset ninja-multi
- name: Build with CMake
run: docker run --rm -v "${{ github.workspace }}:/cpp_tutorials" mycpp_image:latest cmake --build --preset ninja-multi-release
- name: Generate Doxygen documentation
run: docker run --rm -v "${{ github.workspace }}:/cpp_tutorials" mycpp_image:latest doxygen Doxyfile
- name: Upload documentation
uses: actions/upload-artifact@v7
with:
name: cpp_documentation
path: docs/html
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download documentation
uses: actions/download-artifact@v8
with:
name: cpp_documentation
path: html
- name: Zip documentation
run: zip -qr "cpp_tutorials_docs_${{ github.ref_name }}.zip" html
- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
files: cpp_tutorials_docs_${{ github.ref_name }}.zip