-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳Publish docker image for federation server
- Loading branch information
Showing
5 changed files
with
55 additions
and
58 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: pr | |
on: | ||
pull_request_target: | ||
branches: | ||
- tom-builds | ||
- main | ||
merge_group: | ||
workflow_dispatch: | ||
|
||
|
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 |
---|---|---|
|
@@ -4,10 +4,7 @@ | |
name: publish-matrix-invite | ||
|
||
on: | ||
workflow_run: | ||
workflows: [build-and-test] | ||
types: | ||
- completed | ||
workflow_call: | ||
|
||
jobs: | ||
tests: | ||
|
@@ -25,54 +22,14 @@ jobs: | |
files: | | ||
packages/federation-server/**/* | ||
.github/workflows/** | ||
- name: Build and publish matrix-invite docker image | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: philips-software/[email protected] | ||
- name: Publish to dockerhub | ||
uses: elgohr/Publish-Docker-Github-Action@v5 | ||
with: | ||
base-dir: "${{ github.workspace }}/packages/matrix-invite/" | ||
dockerfile: "${{ github.workspace }}/packages/matrix-invite/Dockerfile" | ||
image-name: "twake-matrix-invite" | ||
name: linagora/tom-federation-server | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
workdir: "${{ github.workspace }}/packages/matrix-invite/" | ||
context: . | ||
buildoptions: "-t linagora/twake-matrix-invite" -f Dockerfile | ||
tags: "latest" | ||
env: | ||
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USER }} | ||
REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_PASSWORD }}" | ||
DOCKER_ORGANIZATION: twaketech | ||
|
||
update-doc: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Set up Node LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Generate Swagger documentation | ||
run: npm run doc | ||
- name: Check if documentation files has changed | ||
id: verify-changed-files | ||
uses: tj-actions/verify-changed-files@v17 | ||
with: | ||
files: docs/openapi.json | ||
- name: Update documentation files | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
env: | ||
SPEC_TO_DISPLAY: "openapi.json" | ||
DISABLE_TRY_IT_OUT_JS_METHOD: "const DisableTryItOutPlugin = function() {return {statePlugins:{spec:{wrapSelectors:{allowTryItOutFor:() => () => false}}}}}" | ||
DISABLE_TRY_IT_OUT_PLUGIN: ", DisableTryItOutPlugin" | ||
run: | | ||
yes | cp -rf node_modules/swagger-ui-dist/* docs | ||
sed -i "/window\.onload\s=\sfunction()\s{/a $DISABLE_TRY_IT_OUT_JS_METHOD" docs/swagger-initializer.js | ||
sed -i "s#https://petstore\.swagger\.io/v2/swagger\.json#$SPEC_TO_DISPLAY#g" docs/swagger-initializer.js | ||
sed -i "/SwaggerUIBundle\.plugins\.DownloadUrl/a $DISABLE_TRY_IT_OUT_PLUGIN" docs/swagger-initializer.js | ||
- name: Commit updated documentation files | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: docs | ||
message: 'chore: update documentation' |
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,31 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: publish-tom-federation-server | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
publish-docker: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get all src files that have changed | ||
id: changed-files | ||
uses: tj-actions/changed-files@v41 | ||
with: | ||
files: | | ||
packages/federation-server/**/* | ||
.github/workflows/** | ||
- name: Publish to dockerhub | ||
uses: elgohr/Publish-Docker-Github-Action@v5 | ||
with: | ||
name: linagora/tom-federation-server | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
workdir: "${{ github.workspace }}" | ||
context: . | ||
buildoptions: "-t linagora/tom-federation-server -f Dockerfile" | ||
tags: "latest" |
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