-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Docker setup done * Fix basic auth * Added GitHub Actions
- Loading branch information
1 parent
df3db05
commit 48810f9
Showing
6 changed files
with
98 additions
and
2 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,32 @@ | ||
name: Create release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [closed] | ||
|
||
jobs: | ||
create_release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for the PR label | ||
id: label | ||
uses: zwaldowski/match-label-action@v4 | ||
with: | ||
allowed: major,minor,patch | ||
- name: Bump the version tag | ||
id: next_version | ||
uses: zwaldowski/semver-release-action@v3 | ||
with: | ||
bump: ${{ steps.label.outputs.match }} | ||
prefix: v | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create release | ||
id: create-release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: v${{ steps.next_version.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,19 @@ | ||
name: Pre-merge check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [opened, reopened, synchronize, labeled] | ||
|
||
jobs: | ||
check_pull_request_label: | ||
name: Check pull request label | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for the PR label | ||
id: label | ||
uses: zwaldowski/match-label-action@v4 | ||
with: | ||
allowed: major,minor,patch |
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,22 @@ | ||
# Build stage | ||
FROM registry.access.redhat.com/ubi9/nodejs-18:latest AS builder | ||
|
||
USER root | ||
WORKDIR /app-build | ||
|
||
COPY package.json /app-build/ | ||
COPY package-lock.json /app-build/ | ||
RUN npm ci | ||
|
||
COPY . /app-build | ||
RUN npm run build | ||
|
||
# Copy to the RedHat Nginx image | ||
FROM registry.access.redhat.com/ubi9/nginx-120:latest | ||
|
||
COPY --from=builder /app-build/public "${HOME}" | ||
|
||
COPY nginx/startup.sh /opt/app-root/startup.sh | ||
COPY nginx/logging.conf "${NGINX_CONFIGURATION_PATH}" | ||
|
||
CMD /opt/app-root/startup.sh |
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,6 @@ | ||
log_format ddsoc '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /dev/stdout ddsoc; | ||
error_log /dev/stderr info; |
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,17 @@ | ||
#!/bin/sh | ||
|
||
echo "Starting Nginx" | ||
echo "==============" | ||
echo "" | ||
echo "Is Prod : $IS_PROD" | ||
echo "Basic Auth : $BASIC_AUTH" | ||
echo "Password : $HTPASSWD" | ||
|
||
# If this is not prod, add basic auth | ||
if [ "$IS_PROD" = 'false' ]; then | ||
echo "Not production - implementing basic auth" | ||
echo $BASIC_AUTH | base64 -d > /opt/app-root/etc/nginx.default.d/basic-auth.conf | ||
echo $HTPASSWD | base64 -d > /opt/app-root/etc/.htpasswd | ||
fi | ||
|
||
nginx -g 'daemon off;' |
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