Skip to content

Commit

Permalink
👷 Added GitHub actions for CF Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecarr authored Oct 11, 2022
1 parent d4d21b5 commit bd9e4c9
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "buster"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],

"customizations": {
"vscode": {
"settings": {
"lldb.executable": "/usr/bin/lldb",

"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},

"extensions": [
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates"
]
}
},

"remoteUser": "vscode"
}
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy

on:
push:
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: run
args: --release
- name: Publish
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages publish --project-name=www
5 changes: 0 additions & 5 deletions Caddyfile

This file was deleted.

6 changes: 2 additions & 4 deletions templates/index.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
<p><strong>Hi there! &#128075;</strong></p>
<p>I&apos;m a <%= age %> y/o from the UK, currently working as a <strong>Software Developer</strong> at <strong>Sitel Group</strong>.</p>
<p>As far as open source projects go, I enjoy working on anything and everything related to <strong>education &#127979;</strong>, <strong>privacy &#128064;</strong>, and <strong>data analysis/engineering &#128451;</strong>.</p>
<p>I currently spend most of time in <strong>Rust</strong> and <strong>Python</strong>, and I take pride in writing code that&apos;s <strong>lightweight &#127811;</strong> and <strong>performant &#128170;</strong>!</p>
<p>I currently spend most of time in <strong>Rust</strong> and <strong>TypeScript</strong>, and I take pride in writing code that&apos;s <strong>lightweight &#127811;</strong> and <strong>performant &#128170;</strong>!</p>
</blockquote>
</section>
<section id="about-the-site">
<h2>about this site</h2>
<blockquote>
<p>This site is built using a <strong>custom static site generator</strong> made with <strong>Rust</strong><a href="#site-ref-1"><sup>[1]</sup></a>.</p>
<p>It has <strong>no CSS or JavaScript</strong> and each page weighs in at a <strong>few kilobytes</strong>.</p>
<p>The site is hosted on a single VPS with 1 GiB RAM<a href="#site-ref-2"><sup>[2]</sup></a>, running a sole web server process to serve static files and handle TLS<a href="#site-ref-3"><sup>[3]</sup></a>.</p>
<p>The site is hosted on Cloudflare Pages, using GitHub Actions to automate building and deployment when a new tag is pushed.</p>
<hr>
<p id="site-ref-1"><sup>[1]</sup> <a href="https://github.com/rust-sailfish/sailfish" target="_blank" rel="noopener">Sailfish</a> is used for templating. The entire generator codebase comes in at &lt;100 LOC.</p>
<p id="site-ref-2"><sup>[2]</sup> Hosted at <a href="https://1984.hosting" target="_blank" rel="noopener">1984 Hosting</a>: <strong>not affiliated</strong>, but a very happy customer!</p>
<p id="site-ref-3"><sup>[3]</sup> Web server currently used is <a href="https://caddyserver.com/v2" target="_blank" rel="noopener">Caddy 2</a>.</p>
</blockquote>
</section>
<% include!("./footer.stpl"); %>
Expand Down

0 comments on commit bd9e4c9

Please sign in to comment.