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

Feat/4829 #4837

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions .github/workflows/deploy-maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 06.Deploy Maintenance Mode

on:
push:
branches:
- main
paths:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the changes on this action file?

- maintenance-mode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename directory to maintenance


env:
GITHUB_REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/${{ github.repository }}/maintenance

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
packages: write
contents: read

jobs:
deploy-maintenance:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.GITHUB_REGISTRY }} -u ${{ github.actor }} --password-stdin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really need?


- name: Build and Push Docker Image
uses: egose/actions/docker-build-push@e5cca77343da50a82d2fb2f9e4740457e883eb75
with:
registry-url: ${{ env.GITHUB_REGISTRY }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-name: ${{ env.IMAGE_NAME }}
docker-context: .
docker-file: app/Dockerfile
docker-args: |
deployment_tag=${{ github.sha }}
metadata-tags: |
type=ref,event=branch
type=sha,format=long,prefix=,suffix=

- name: Display Image URL
run: |
echo "Image URL: ${{ env.IMAGE_NAME }}:${{ github.sha }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this for debugging?

12 changes: 12 additions & 0 deletions maintenance-mode/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nginx:1.25.3-alpine

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many break lines



RUN addgroup -S nonroot && adduser -S nonroot -G nonroot

COPY static /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf

RUN chown -R nonroot:nonroot /usr/share/nginx/html /etc/nginx/nginx.conf
USER nonroot
EXPOSE 3000
53 changes: 53 additions & 0 deletions maintenance-mode/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
pid /tmp/nginx.pid;

worker_processes auto;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;

sendfile on;
keepalive_timeout 65;

# Main server block
server {
listen 3000;
server_name localhost;

access_log off;
error_log /dev/stderr; # Useful for debugging in OpenShift logs

add_header cross-origin-embedder-policy "require-corp";
add_header cross-origin-opener-policy "same-origin";
add_header cross-origin-resource-policy "same-origin";
add_header x-dns-prefetch-control "off";
add_header expect-ct "max-age=0";
add_header x-frame-options "SAMEORIGIN";
add_header strict-transport-security "max-age=15552000; includeSubDomains";
add_header x-download-options "noopen";
add_header x-content-type-options "nosniff";
add_header origin-agent-cluster "?1";
add_header x-permitted-cross-domain-policies "none";
add_header referrer-policy "strict-origin";
add_header x-xss-protection "0";
add_header permissions-policy "midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()";

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri.html $uri/index.html /index.html;
}

error_page 404 /index.html;
}
}
22 changes: 22 additions & 0 deletions maintenance-mode/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Maintenance</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="message-box">
<div class="animated-icon">⚙️</div>
<h1>We'll Be Back Soon!</h1>
<p>
Registry site is currently undergoing scheduled maintenance. We apologize for the inconvenience and appreciate
your patience.
</p>
<footer>&copy; 2025 B.C. Gov's Platform Product Registry</footer>
</div>
</div>
</body>
</html>
71 changes: 71 additions & 0 deletions maintenance-mode/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* General Reset */
body,
html {
margin: 0;
padding: 0;
box-sizing: border-box;
width: 100%;
height: 100%;
font-family: 'Arial', sans-serif;
color: #333;
background: #f4f4f9;
}

/* Centering Container */
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
text-align: center;
padding: 20px;
}

/* message Box */
.message-box {
max-width: 600px;
padding: 30px;
background: #ffffff; /* White card */
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}

/* Heading */
h1 {
font-size: 2.5rem;
color: #ff5733;
margin-bottom: 20px;
}

/* Subtext */
p {
font-size: 1.1rem;
color: #666;
margin-bottom: 20px;
line-height: 1.6;
}

/* Animation */
.animated-icon {
font-size: 3rem;
color: #ff5733;
animation: bounce 1.5s infinite;
}

/* Bounce Animation */
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}

/* Footer */
footer {
font-size: 0.9rem;
color: #999;
margin-top: 20px;
}