diff --git a/.github/workflows/tag-staging.yml b/.github/workflows/tag-staging.yml index eb5fa878..eaadf89e 100644 --- a/.github/workflows/tag-staging.yml +++ b/.github/workflows/tag-staging.yml @@ -52,7 +52,8 @@ jobs: KUBE_CLUSTER: ${{ secrets.KUBE_CLUSTER }} - name: Update PR with success run: | - gh pr comment $PRNUM --body "🚀 Deploying to [staging environment](https://moj-frontend-staging.apps.live.cloud-platform.service.justice.gov.uk/)" + echo -e "🚀 Deploying to [staging environment](https://moj-frontend-staging.apps.live.cloud-platform.service.justice.gov.uk/)\n\n**Username:** \`staging\`, **Password:** \`moj\`" > comment.txt + gh pr comment $PRNUM --body-file comment.txt gh pr edit $PRNUM --remove-label "staging:request" gh pr edit $PRNUM --add-label "staging:active" env: diff --git a/Dockerfile b/Dockerfile index 052727a5..a4990e4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ FROM nginxinc/nginx-unprivileged:alpine AS nginx EXPOSE 3000 +COPY docker/htpasswd /etc/nginx/.htpasswd COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/public /usr/share/nginx/html diff --git a/docker/htpasswd b/docker/htpasswd new file mode 100644 index 00000000..41302517 --- /dev/null +++ b/docker/htpasswd @@ -0,0 +1 @@ +staging:$apr1$aOnwYL2z$pC8FxfkQ8MQbYJ0ScqJv10 diff --git a/docker/nginx.conf b/docker/nginx.conf index fc85f27e..5ba4f178 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -7,6 +7,9 @@ server { location / { root /usr/share/nginx/html; index index.html index.htm; + + auth_basic "Staging site"; + auth_basic_user_file /etc/nginx/.htpasswd; } error_page 500 502 503 504 /50x.html;