Merge branch 'master' into next
This commit is contained in:
136
.github/workflows/docker-build-push.yml
vendored
Normal file
136
.github/workflows/docker-build-push.yml
vendored
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
# inspired by https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
||||||
|
name: Build & Push SwaggerUI multi platform Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
git_ref:
|
||||||
|
description: Git branch, tag or SHA to checkout.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
docker_tag:
|
||||||
|
description: Docker tag associated with the `git_ref`
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
repository_dispatch:
|
||||||
|
type: [docker_build_push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY_IMAGE: swaggerapi/swagger-ui
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
inputs:
|
||||||
|
name: Normalize inputs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
git_ref: ${{ steps.workflow_dispatch.outputs.git_ref || steps.repository_dispatch.outputs.git_ref }}
|
||||||
|
docker_tag: ${{ steps.workflow_dispatch.outputs.docker_tag || steps.repository_dispatch.outputs.docker_tag }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Normalize inputs of `workflow_dispatch` event
|
||||||
|
id: workflow_dispatch
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
echo "git_ref=${{ inputs.git_ref }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "docker_tag=${{ inputs.docker_tag }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Normalize inputs of `repository_dispatch` event
|
||||||
|
id: repository_dispatch
|
||||||
|
if: ${{ github.event_name == 'repository_dispatch' }}
|
||||||
|
run: |
|
||||||
|
echo "git_ref=${{ github.event.client_payload.git_ref }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "docker_tag=${{ github.event.client_payload.docker_tag }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build & Push SwaggerUI platform specific Docker images
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
# linux/amd64 is already built by Jenkins
|
||||||
|
- linux/arm/v6
|
||||||
|
- linux/arm/v7
|
||||||
|
- linux/arm64/v8
|
||||||
|
- linux/386
|
||||||
|
- linux/ppc64le
|
||||||
|
- linux/s390x
|
||||||
|
needs:
|
||||||
|
- inputs
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.inputs.outputs.git_ref }}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Log in to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push by digest
|
||||||
|
id: build
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
provenance: false
|
||||||
|
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
|
- name: Export digest
|
||||||
|
run: |
|
||||||
|
mkdir -p /tmp/digests
|
||||||
|
digest="${{ steps.build.outputs.digest }}"
|
||||||
|
touch "/tmp/digests/${digest#sha256:}"
|
||||||
|
|
||||||
|
- name: Upload digest
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: digests
|
||||||
|
path: /tmp/digests/*
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
merge:
|
||||||
|
name: Merge platform specific Docker image into multi platform image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- inputs
|
||||||
|
- build
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download digests
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: digests
|
||||||
|
path: /tmp/digests
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Create manifest list and push
|
||||||
|
working-directory: /tmp/digests
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }} \
|
||||||
|
${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }} \
|
||||||
|
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
|
||||||
|
|
||||||
|
- name: Inspect image
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }}
|
||||||
498
package-lock.json
generated
498
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@@ -6,6 +6,7 @@
|
|||||||
"exports": {
|
"exports": {
|
||||||
"./dist/swagger-ui.css": "./dist/swagger-ui.css",
|
"./dist/swagger-ui.css": "./dist/swagger-ui.css",
|
||||||
"./dist/oauth2-redirect.html": "./dist/oauth2-redirect.html",
|
"./dist/oauth2-redirect.html": "./dist/oauth2-redirect.html",
|
||||||
|
"./dist/swagger-ui-standalone-preset": "./dist/swagger-ui-standalone-preset.js",
|
||||||
".": {
|
".": {
|
||||||
"import": "./dist/swagger-ui-es-bundle-core.js",
|
"import": "./dist/swagger-ui-es-bundle-core.js",
|
||||||
"require": "./dist/swagger-ui.js"
|
"require": "./dist/swagger-ui.js"
|
||||||
@@ -112,12 +113,12 @@
|
|||||||
"@babel/preset-env": "=7.21.5",
|
"@babel/preset-env": "=7.21.5",
|
||||||
"@babel/preset-react": "=7.18.6",
|
"@babel/preset-react": "=7.18.6",
|
||||||
"@babel/register": "=7.21.0",
|
"@babel/register": "=7.21.0",
|
||||||
"@commitlint/cli": "^17.6.1",
|
"@commitlint/cli": "^17.6.5",
|
||||||
"@commitlint/config-conventional": "^17.6.3",
|
"@commitlint/config-conventional": "^17.6.3",
|
||||||
"@jest/globals": "=29.5.0",
|
"@jest/globals": "=29.5.0",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
||||||
"@release-it/conventional-changelog": "=5.1.0",
|
"@release-it/conventional-changelog": "=5.1.0",
|
||||||
"@wojtekmaj/enzyme-adapter-react-17": "=0.6.6",
|
"@wojtekmaj/enzyme-adapter-react-17": "=0.8.0",
|
||||||
"autoprefixer": "^10.4.12",
|
"autoprefixer": "^10.4.12",
|
||||||
"babel-loader": "^9.1.2",
|
"babel-loader": "^9.1.2",
|
||||||
"babel-plugin-lodash": "=3.3.4",
|
"babel-plugin-lodash": "=3.3.4",
|
||||||
@@ -133,7 +134,7 @@
|
|||||||
"dedent": "^0.7.0",
|
"dedent": "^0.7.0",
|
||||||
"deepmerge": "^4.3.1",
|
"deepmerge": "^4.3.1",
|
||||||
"enzyme": "=3.11.0",
|
"enzyme": "=3.11.0",
|
||||||
"eslint": "^8.37.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-plugin-import": "^2.25.4",
|
"eslint-plugin-import": "^2.25.4",
|
||||||
"eslint-plugin-jest": "^26.1.1",
|
"eslint-plugin-jest": "^26.1.1",
|
||||||
"eslint-plugin-mocha": "^10.1.0",
|
"eslint-plugin-mocha": "^10.1.0",
|
||||||
@@ -150,7 +151,7 @@
|
|||||||
"jest-environment-jsdom": "=29.5.0",
|
"jest-environment-jsdom": "=29.5.0",
|
||||||
"jsdom": "=21.1.1",
|
"jsdom": "=21.1.1",
|
||||||
"json-loader": "^0.5.7",
|
"json-loader": "^0.5.7",
|
||||||
"json-merger": "^1.1.9",
|
"json-merger": "^1.1.10",
|
||||||
"json-server": "=0.17.3",
|
"json-server": "=0.17.3",
|
||||||
"less": "^4.1.2",
|
"less": "^4.1.2",
|
||||||
"license-checker": "^25.0.0",
|
"license-checker": "^25.0.0",
|
||||||
@@ -170,10 +171,10 @@
|
|||||||
"react-refresh": "^0.14.0",
|
"react-refresh": "^0.14.0",
|
||||||
"react-test-renderer": "=17.0.2",
|
"react-test-renderer": "=17.0.2",
|
||||||
"release-it": "=15.4.2",
|
"release-it": "=15.4.2",
|
||||||
"rimraf": "^5.0.0",
|
"rimraf": "^5.0.1",
|
||||||
"sass": "^1.62.1",
|
"sass": "^1.62.1",
|
||||||
"sass-loader": "^13.3.0",
|
"sass-loader": "^13.3.0",
|
||||||
"sinon": "=15.0.4",
|
"sinon": "=15.1.0",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"start-server-and-test": "^2.0.0",
|
"start-server-and-test": "^2.0.0",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
@@ -182,7 +183,7 @@
|
|||||||
"webpack": "^5.82.1",
|
"webpack": "^5.82.1",
|
||||||
"webpack-bundle-size-analyzer": "^3.1.0",
|
"webpack-bundle-size-analyzer": "^3.1.0",
|
||||||
"webpack-cli": "^4.10.0",
|
"webpack-cli": "^4.10.0",
|
||||||
"webpack-dev-server": "^4.7.4",
|
"webpack-dev-server": "^4.15.0",
|
||||||
"webpack-node-externals": "=3.0.0",
|
"webpack-node-externals": "=3.0.0",
|
||||||
"webpack-stats-plugin": "=1.1.1"
|
"webpack-stats-plugin": "=1.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user