-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TCVP-2825 Created static maintenance site
- Loading branch information
Showing
5 changed files
with
276 additions
and
0 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,37 @@ | ||
name: Build Maintenance Site | ||
|
||
# This workflow will automatically build the maintenance-site project on the creation of a tag in Github. | ||
# The build is then pushed to Openshift, tagged with the gitsha, ie. maintenance-site:5adf53 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to OpenShift | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{secrets.OPENSHIFT_EXTERNAL_REPOSITORY}} | ||
username: ${{secrets.OPENSHIFT_SA_USERNAME}} | ||
password: ${{secrets.OPENSHIFT_SA_PASSWORD}} | ||
|
||
- name: Build and push | ||
env: | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
CONTEXT: ./infrastructure/static-site/maintenance | ||
IMAGE: ${{secrets.OPENSHIFT_EXTERNAL_REPOSITORY}}/${{secrets.OPENSHIFT_TOOLS_NAMESPACE}}/maintenance-site | ||
run: | | ||
git_sha=$(git rev-parse --short HEAD) | ||
docker build --tag ${IMAGE}:latest -f ${CONTEXT}/Dockerfile ${CONTEXT} | ||
docker push ${IMAGE}:latest | ||
docker tag ${IMAGE}:latest ${IMAGE}:${git_sha} | ||
docker push ${IMAGE}:${git_sha} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM docker.io/nginx:stable-alpine | ||
|
||
COPY ./index.html /usr/share/nginx/html/index.html | ||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
|
||
USER root | ||
|
||
# Create necessary directories and set permissions | ||
RUN mkdir -p /usr/share/nginx/tmp/client_temp /usr/share/nginx/tmp/proxy_temp /usr/share/nginx/tmp/fastcgi_temp /usr/share/nginx/tmp/uwsgi_temp /usr/share/nginx/tmp/scgi_temp && \ | ||
chown -R nginx:nginx /usr/share/nginx/tmp && \ | ||
chmod -R 777 /usr/share/nginx/tmp | ||
|
||
EXPOSE 8080 | ||
|
||
USER nginx | ||
|
||
CMD ["sh", "-c", "nginx -g 'daemon off;'"] |
Oops, something went wrong.