Skip to content

Commit

Permalink
feat: adds first attempt at staging server
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthipe committed Jul 22, 2023
1 parent 399941e commit cf5aa34
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to staging server

on:
push:
branches: ["develop"]

permissions:
contents: read
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "https://www.pencethren.org/~wutan/"
env:
JEKYLL_ENV: staging
- name: Deploy to server
uses: appleboy/scp-action@v0.1.4
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: "./_site/*"
target: public_html
overwrite: true

11 changes: 11 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }} – {{ site.description }}</title>
{% seo title=false %}
{% include meta.html %}
{% if jekyll.environment == 'staging' %}
<meta name="robots" content="noindex" />
{% endif %}

<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/assets/style.css" />
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}"
Expand All @@ -18,6 +21,14 @@
<body>
<div class="wrapper-container">
<div class="wrapper-masthead">
{% if jekyll.environment == 'staging'%}
<p class="banner">
<a href="https://www.wutanbath.org.uk/">
This is a development version of the site. Click here to see the live
content.
</a>
</p>
{% endif %}
<div class="container">
<header class="masthead clearfix">
<a href="{{ site.baseurl }}/" class="site-avatar"><img src="{{ site.baseurl }}{{ site.avatar }}"
Expand Down
6 changes: 6 additions & 0 deletions assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,12 @@ Modules - reusable parts of our design
}
}

.banner {
position: absolute;
width: 20rem;
padding: 1rem;
border: 1px solid black;
}

// Settled on moving the import of syntax highlighting to the bottom of the CSS
// ... Otherwise it really bloats up the top of the CSS file and makes it difficult to find the start
Expand Down

0 comments on commit cf5aa34

Please sign in to comment.