-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate deployment of API viewer to GitHub Pages (#1283)
- Loading branch information
Showing
9 changed files
with
85 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Deploy API viewer to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
contents: read | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'maven' | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Build API viewer | ||
run: mvn -B -V -e -ntp -Pquick-build clean verify | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ./job-dsl-plugin/target/gh-pages | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
const path = require("path"); | ||
const CopyPlugin = require("copy-webpack-plugin"); | ||
|
||
module.exports = merge(common, { | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
devServer: { | ||
static: "./src/main/webapp/api-viewer", | ||
static: "target/dev-api-viewer", | ||
}, | ||
plugins: [ | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ from: "src/main/json/development/config.json" }, | ||
{ from: "src/main/json/static/config.json" }, | ||
{ from: "target/update-center.json" }, | ||
{ from: "target/versions/*.json", to: "[name][ext]" }, | ||
], | ||
}), | ||
], | ||
output: { | ||
path: path.join(__dirname, "target/dev-api-viewer"), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
const path = require("path"); | ||
const CopyPlugin = require("copy-webpack-plugin"); | ||
|
||
module.exports = merge(common, { | ||
mode: "production", | ||
plugins: [ | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ from: "src/main/json/static/config.json" }, | ||
{ from: "target/update-center.json" }, | ||
{ from: "target/versions/*.json", to: "[name][ext]" }, | ||
], | ||
}), | ||
], | ||
output: { | ||
path: path.join(__dirname, "target/gh-pages"), | ||
}, | ||
}); |
6 changes: 5 additions & 1 deletion
6
job-dsl-plugin/webpack.prod.js → job-dsl-plugin/webpack.plugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common.js"); | ||
const path = require("path"); | ||
const CopyPlugin = require("copy-webpack-plugin"); | ||
|
||
module.exports = merge(common, { | ||
mode: "production", | ||
plugins: [ | ||
new CopyPlugin({ | ||
patterns: [ | ||
{ from: "src/main/json/production/config.json" }, | ||
{ from: "src/main/json/embedded/config.json" }, | ||
], | ||
}), | ||
], | ||
output: { | ||
path: path.join(__dirname, "src/main/webapp/api-viewer"), | ||
}, | ||
}); |