-
Notifications
You must be signed in to change notification settings - Fork 176
157 lines (151 loc) · 5.31 KB
/
Copy pathbuild.yml
File metadata and controls
157 lines (151 loc) · 5.31 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
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
name: Build
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
pages: write
id-token: write
jobs:
build_java17:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Microservices build with Maven
run: mvn -B install --file quarkus-workshop-super-heroes/pom.xml
- name: Native build with Maven
run: mvn -B install --file quarkus-workshop-super-heroes/pom.xml -Pnative -Dquarkus.native.container-build=true -DskipITs -pl '!:rest-narration,!:extension-version'
docs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ "all","linux","mac","windows" ]
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Site generation prep
run: |
sudo apt-get install graphviz
export BASE_URL=`curl -Ls -o /dev/null -w %{url_effective} -I ${GITHUB_REPOSITORY_OWNER}.github.io`
- name: Install Playwright
run: |
cd quarkus-workshop-super-heroes/docs
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.classpathScope=test -D exec.args="install --with-deps chromium"
- name: Build and test site
run: |
cd quarkus-workshop-super-heroes/docs
mvn package -Dos=${{ matrix.os }}
- name: Publishing fragment
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.os }}-fragments
path: ./quarkus-workshop-super-heroes/docs/target/generated-asciidoc
if-no-files-found: error
retention-days: 3
publication:
needs: [ docs, build_java17 ]
runs-on: ubuntu-latest
steps:
- name: Download default site
uses: actions/download-artifact@v8
with:
name: all-fragments
path: target/generated-asciidoc
# take the all- package to be the top-level
- name: Download Linux site
uses: actions/download-artifact@v8
with:
name: linux-fragments
path: target/generated-asciidoc/linux
- name: Download Mac site
uses: actions/download-artifact@v8
with:
name: mac-fragments
path: target/generated-asciidoc/mac
- name: Download Windows site
uses: actions/download-artifact@v8
with:
name: windows-fragments
path: target/generated-asciidoc/windows
- name: Site assembly
run: |
# aggregate the fragments
# Take just the contents of the variants folders for the other platforms
cp -r target/generated-asciidoc/linux/variants/* target/generated-asciidoc/variants
cp -r target/generated-asciidoc/mac/variants/* target/generated-asciidoc/variants
cp -r target/generated-asciidoc/windows/variants/* target/generated-asciidoc/variants
# Move things around to preserve the super-heroes structure
mkdir -p target/site/super-heroes
cp -R target/generated-asciidoc/* target/site/super-heroes
# Move the redirect.html page to the root
cp target/generated-asciidoc/redirect.html target/site/index.html
- name: Store PR id
if: "github.event_name == 'pull_request'"
run: echo ${{ github.event.number }} > ./target/site/pr-id.txt
- name: Publishing directory for PR preview
uses: actions/upload-artifact@v7
with:
name: site
path: ./target/site
retention-days: 3
test-docs:
needs: [ publication ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Download assembled site
uses: actions/download-artifact@v8
with:
name: site
path: target/site
- name: Install Playwright
run: |
cd quarkus-workshop-super-heroes/docs
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.classpathScope=test -D exec.args="install --with-deps chromium"
- name: Run documentation tests
run: |
cd quarkus-workshop-super-heroes/docs
mvn test -Ddocs.base.path=../../target/site/super-heroes
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: quarkus-workshop-super-heroes/docs/target/surefire-reports
retention-days: 7
deploy:
if: "github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'schedule')"
needs: [ publication, test-docs ]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download Built site
uses: actions/download-artifact@v8
with:
name: site
path: site
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4