Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1545] Initial changes to add documentation on prod URL #1546

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/composite-actions/ssh-docker-compose/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
docker-compose-file-frontend-build:
description: 'Docker compose for frontend build file location'
required: true
docker-compose-file-documentation-build:
description: 'Docker compose for documentation build file location'
required: true
ci_commit:
description: 'Commit ID'
required: true
Expand All @@ -34,6 +37,10 @@ runs:
run: .github/composite-actions/ssh-docker-compose/git-pull.sh ${{ inputs.server-ip }} ${{ inputs.server-ssh-port }} ${{ inputs.server-ssh-user }}
shell: bash

- name: Rebuild Documentation
run: .github/composite-actions/ssh-docker-compose/documentation-build.sh ${{ inputs.server-ip }} ${{ inputs.server-ssh-port }} ${{ inputs.server-ssh-user }} ${{ inputs.docker-compose-file-documentation-build }} ${{ inputs.ci_commit }}
shell: bash

- name: Rebuild Frontend
run: .github/composite-actions/ssh-docker-compose/frontend-build.sh ${{ inputs.server-ip }} ${{ inputs.server-ssh-port }} ${{ inputs.server-ssh-user }} ${{ inputs.docker-compose-file-frontend-build }} ${{ inputs.ci_commit }}
shell: bash
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -eu

# ${1} for Server IP
# ${2} for Server Port
# ${3} for Server User
# ${4} for Dockerfile location

server_ip="${1}"
server_port="${2}"
server_user="${3}"
docker_compose_file="${4}"
ci_commit="${5}"

ssh -i priv.key -o BatchMode=yes \
-p "${server_port}" \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
"${server_user}"@"${server_ip}" "cd src/deploy && CI_COMMIT=${ci_commit} docker compose -f ${docker_compose_file} up --build"
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
server-ssh-user: ${{ secrets.SERVER_SSH_USER }}
docker-compose-file: ${{ secrets.DOCKER_COMPOSE_FILE }}
docker-compose-file-frontend-build: ${{ secrets.DOCKER_COMPOSE_FILE_FRONTEND_BUILD }}
docker-compose-file-documentation-build: ${{ secrets.DOCKER_COMPOSE_FILE_DOCUMENTATION_BUILD }}
ci_commit: ${{ env.COMMIT_SHORT_SHA }}

mobile-app-release:
Expand Down
18 changes: 18 additions & 0 deletions deploy/docker-compose.documentation-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
services:
documentation_build:
image: akvo/akvo-sphinx:20220525.082728.594558b
container_name: documentation_build
working_dir: /docs
environment:
- CI_COMMIT=${CI_COMMIT}
command:
- /bin/bash
- -c
- |
ls -la
make html
cp -r build/html ../frontend/public/documentation
volumes:
- ../docs:/docs:delegated
- ../frontend:/frontend:delegated
7 changes: 7 additions & 0 deletions deploy/generate_dynamic_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ http:
service: frontend-service
tls:
certResolver: myresolver
middlewares:
- redirect-documentation

middlewares:
redirect-to-https:
redirectScheme:
scheme: "https"
permanent: true

redirect-documentation:
redirectRegex:
regex: "^https://${WEBDOMAIN}/documentation$"
replacement: "https://${WEBDOMAIN}/documentation/"
permanent: true

services:
frontend-service:
Expand Down