-
Notifications
You must be signed in to change notification settings - Fork 12
108 lines (93 loc) · 2.67 KB
/
build.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
name: SmallRye Website
on:
push:
branches:
- develop
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'NOTICE'
- 'README*'
pull_request:
branches:
- develop
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'NOTICE'
- 'README*'
jobs:
build:
runs-on: ubuntu-latest
services:
kroki:
image: yuzutech/kroki
env:
KROKI_MERMAID_HOST: kroki-mermaid
ports:
- 8000:8000
kroki-mermaid:
image: yuzutech/kroki-mermaid
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: generate website
env:
JEKYLL_ENV: production
run: |
mkdir website
bundle install
bundle exec jekyll build --destination website
- name: generate docs
run: |
cd docs
npm i @antora/[email protected] @antora/[email protected] asciidoctor-kroki
./node_modules/@antora/cli/bin/antora antora generate antora-playbook.yml
cd ..
cp -r docs/build/site website/docs
- name: attach website
uses: actions/upload-artifact@v4
with:
name: website
path: website
deploy:
needs: [build]
if: github.event_name == 'push' && github.repository_owner == 'smallrye'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
name: Create GitHub App Token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: main
token: ${{steps.app-token.outputs.token}}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Configure Git author
run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: extract website
uses: actions/download-artifact@v4
with:
name: website
- name: push website
run: |
git status
git diff
git add -A .
git commit -m "CI: Build and deploy website updates"
git push --force