generated from creek-service/single-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
135 lines (126 loc) · 5.11 KB
/
gh-pages.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
name: GitHub Pages
on:
push:
branches: [ main]
pull_request:
branches: [ main ]
schedule:
- cron: "23 9 */14 * *"
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
# Allow one concurrent deployment, per branch
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
get_impls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
with:
gradle-home-cache-cleanup: true
- name: Extract implementation info
run: ./gradlew --quiet extractImplementations > implementations.json
- name: Add results to step summary
run: cat implementations.json >> $GITHUB_STEP_SUMMARY
- name: Upload Implementations
uses: actions/upload-artifact@v3
with:
name: implementations
path: implementations.json
retention-days: 1
run_functional:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
with:
gradle-home-cache-cleanup: true
- name: Run functional tests
run: ./gradlew --quiet runFunctionalTests
- name: Add results to step summary
echo "# Overall comparison" >> $GITHUB_STEP_SUMMARY
cat build/reports/creek/functional-summary.md >> $GITHUB_STEP_SUMMARY
echo ""# Specific Draft & Implementation results"" >> $GITHUB_STEP_SUMMARY
cat build/reports/creek/per-draft.md >> $GITHUB_STEP_SUMMARY
- name: Upload Implementations
uses: actions/upload-artifact@v3
with:
name: functional-summary
path: build/reports/creek/functional-summary.md
retention-days: 1
build_pages:
needs: [get_impls, run_functional]
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/docs/Gemfile
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.4.0
with:
fetch-depth: 0 # need full history to get page last modified times
- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.1'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6
- name: Download Implementations JSON
uses: actions/download-artifact@v3
with:
name: implementations
- name: Inject Implementations JSON into site
run: sed -i $'/IMPLEMENTATIONS_JSON/ { r implementations.json\nd }' "docs/_docs/*"
- name: Download Functional JSON
uses: actions/download-artifact@v3
with:
name: functional-summary
- name: Inject Functional JSON into site
run: sed -i $'/FUNCTIONAL_SUMMARY_JSON/ { r build/reports/creek/functional-summary.json\nd }' "docs/_docs/*"
- name: Build with Jekyll
# Outputs to the './docs/_site' directory by default
run: (cd docs && bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}")
env:
JEKYLL_ENV: production
- name: Upload artifact
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
with:
path: "docs/_site/"
# Deployment job
deploy_pages:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build_pages
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5 # v2.0.4
- name: Ping Google Search
run: curl "https://www.google.com/ping?sitemap=https://www.creekservice.org/${{ github.event.repository.name }}/sitemap.xml"