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

Add error pages #4

Merged
merged 3 commits into from
Jan 4, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
deactivate

# Reload supervisor
sudo supervisorctl reload
sudo supervisorctl restart flask_app
38 changes: 38 additions & 0 deletions .github/workflows/test_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2024 Alec Delaney
# SPDX-License-Identifier: MIT

name: Publish Test Site

on:
pull_request:
branches: ['main']

jobs:
publish-test-website:
runs-on: ubuntu-latest
steps:
- name: Update and deploy on server
uses: appleboy/[email protected]
with:
host: tekktrik.dev
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
# Change to directory
cd /home/test-tekktrik-dev

# Update the repository
git fetch
git checkout main
git config pull.rebase true
git pull --rebase -ff

# Update the environment
rm -rf .venv
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate

# Reload supervisor
sudo supervisorctl start test_flask_app
39 changes: 39 additions & 0 deletions .github/workflows/test_unpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2024 Alec Delaney
# SPDX-License-Identifier: MIT

name: Unpublish Test Site

on:
pull_request:
types: [closed]
branches: ['main']

jobs:
unpublish-test-website:
runs-on: ubuntu-latest
steps:
- name: Stop on server
uses: appleboy/[email protected]
with:
host: tekktrik.dev
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
# Change to directory
cd /home/test-tekktrik-dev

# Update the repository
git fetch
git checkout main
git config pull.rebase true
git pull --rebase -ff

# Update the environment
rm -rf .venv
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate

# Stop supervisor
sudo supervisorctl stop test_flask_app
22 changes: 22 additions & 0 deletions assets/not_testing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
SPDX-FileCopyrightText: 2024 Alec Delaney
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Testing Not In Progress</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<main class="container">
<h1 class="text-center">Testing Not In Progress</h1>
<p class="text-center">This subdomain is only used during testing.</p>
<p class="text-center"> Head to <a href="https://tekktrik.dev">the main site</a> for the deployed version!</p>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions assets/site_down.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
SPDX-FileCopyrightText: 2024 Alec Delaney
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Temporary Outage</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<main class="container">
<h1 class="text-center">Site Temporarily Down</h1>
<p class="text-center">This site is temporarily down, likely due to maintenence or upgrade.</p>
<p class="text-center">Please wait a minute a reload the page. If the issue still persists, check back shortly!</p>
<p class="text-center">Feel free to <a href="mailto:[email protected]">email me</a> about this issue!</p>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>