Skip to content

Commit

Permalink
docs: add password for staging environment (#535)
Browse files Browse the repository at this point in the history
This will avoid the staging environment being indexed by search engines

The username/password are published publicly on the PR because they're not secret
  • Loading branch information
gregtyler authored Nov 17, 2023
1 parent 3fef6a5 commit 722f7e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/tag-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions docker/htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
staging:$apr1$aOnwYL2z$pC8FxfkQ8MQbYJ0ScqJv10
3 changes: 3 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 722f7e0

Please sign in to comment.