Skip to content

Commit

Permalink
chore: auto deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Oct 8, 2024
1 parent 81824d8 commit a3bcf98
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 20 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy

on:
workflow_dispatch:
# push:
# branches:
# - main


jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Rollout the deployment
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: ${{ secrets.DEPLOY_SCRIPT }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ cython_debug/
/_build/
/static/
/media/
local.py
14 changes: 0 additions & 14 deletions home/static/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
font-family: 'Nunito', Arial, sans-serif;
padding: 160px 20px 120px;
color: white;
background-color: #009cdf;
background-image:
linear-gradient(45deg, #00b7eb 25%, transparent 25%),
linear-gradient(-45deg, #00b7eb 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #00b7eb 75%),
linear-gradient(-45deg, transparent 75%, #00b7eb 75%);
background-size: 40px 40px;
background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

.banner h1 {
Expand Down Expand Up @@ -42,10 +34,4 @@
box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

.intro {
display: flex;
align-items: center;
gap: 1em;
}


7 changes: 4 additions & 3 deletions home/templates/home/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ <h1>PyCon China 2024</h1>
<a href="#" class="cta-button">敬请期待</a>
</section>
<main class="content">
<section class="intro">
{{ page.about|richtext }}
<section class="card">
<div class="card-body">
{{ page.about|richtext }}
</div>
</section>
</main>
{% endblock %}

42 changes: 39 additions & 3 deletions pycon/static/css/pycon.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ body {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: #009cdf;
background-image:
linear-gradient(to right,
rgba(0, 156, 223, 0) 0%,
rgba(0, 156, 223, 0) 20%,
rgba(0, 156, 223, 1) 40%,
rgba(0, 156, 223, 1) 100%
),
linear-gradient(45deg, #00b7eb 25%, transparent 25%),
linear-gradient(-45deg, #00b7eb 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #00b7eb 75%),
linear-gradient(-45deg, transparent 75%, #00b7eb 75%);
background-size: 100% 100%, 40px 40px, 40px 40px, 40px 40px, 40px 40px;
background-position: 0 0, 0 0, 0 20px, 20px -20px, -20px 0px;
background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}

h2 {
Expand All @@ -33,9 +48,8 @@ a:hover {
}

.content {
max-width: 1200px;
margin: 0 auto;
padding: 40px 20px;
margin-top: -60px;
margin-bottom: 60px;
}

.content a {
Expand Down Expand Up @@ -63,6 +77,9 @@ a:hover {
font-size: 0.8em;
}

.content img {
max-width: 100%;
}

.navbar {
background-color: #3776ab;
Expand Down Expand Up @@ -179,3 +196,22 @@ footer i {
justify-content: center;
}
}

.card {
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 0, 0, 0.05);
padding: 2rem;
position: relative;
z-index: 1;
max-width: 1200px;
margin: 0 auto;
}

@media (min-width: 992px) {
.card-body {
display: flex;
align-items: center;
gap: 1em;
}
}
12 changes: 12 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -ex

git fetch origin
git reset --hard origin/main

pdm sync

source .venv/bin/activate
export DJANGO_SETTINGS_MODULE=pycon.settings.production
python manage.py migrate --noinput
sudo systemctl restart pycon.service

0 comments on commit a3bcf98

Please sign in to comment.