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 a "Deploy to Linode" build step #118

Merged
merged 1 commit into from
Feb 2, 2025
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
31 changes: 19 additions & 12 deletions .github/workflows/build_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,24 @@ jobs:
- name: "Render the data as HTML"
run: python3 render_data_as_html.py

- name: "Install the Netlify CLI"
run: npm install -g netlify-cli

- name: "Deploy to Netlify (preview)"
if: github.ref != 'refs/heads/main'
run: netlify deploy --dir=_html/
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

- name: "Deploy to Netlify (live)"
- name: Deploy to Linode
if: github.ref == 'refs/heads/main'
run: netlify deploy --dir=_html/ --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
# Get the SSH host keys for my web server
mkdir -p ~/.ssh
ssh-keyscan -H "alexwlchan.net" >> ~/.ssh/known_hosts

# Save the deploy key to a file, so it can be used by
# the SSH process
echo "$DEPLOY_KEY" > id_rsa
chmod 600 id_rsa

# Run the rsync command to upload the _site folder to
# my web server
bash scripts/upload_site.sh \
--rsh="ssh -i id_rsa -o IdentityAgent=none -o HostKeyAlgorithms=ssh-ed25519"

# Clean up the SSH key
rm id_rsa
23 changes: 1 addition & 22 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,12 @@ certifi==2023.11.17
# -r requirements.txt
# httpcore
# httpx
cffi==1.17.1
# via
# -r requirements.txt
# cryptography
click==8.1.7
# via interrogate
colorama==0.4.6
# via interrogate
coverage[toml]==7.6.4
coverage==7.6.4
# via pytest-cov
cryptography==43.0.1
# via
# -r requirements.txt
# secretstorage
h11==0.14.0
# via
# -r requirements.txt
Expand Down Expand Up @@ -67,11 +59,6 @@ jaraco-functools==4.0.1
# via
# -r requirements.txt
# keyring
jeepney==0.8.0
# via
# -r requirements.txt
# keyring
# secretstorage
jinja2==3.1.5
# via -r requirements.txt
keyring==25.6.0
Expand Down Expand Up @@ -99,10 +86,6 @@ pluggy==1.5.0
# via pytest
py==1.11.0
# via interrogate
pycparser==2.22
# via
# -r requirements.txt
# cffi
pytest==8.3.4
# via
# -r dev_requirements.in
Expand All @@ -111,10 +94,6 @@ pytest-cov==6.0.0
# via -r dev_requirements.in
ruff==0.9.4
# via -r dev_requirements.in
secretstorage==3.3.3
# via
# -r requirements.txt
# keyring
six==1.16.0
# via
# -r requirements.txt
Expand Down
9 changes: 0 additions & 9 deletions netlify.toml

This file was deleted.

12 changes: 0 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ certifi==2023.11.17
# via
# httpcore
# httpx
cffi==1.17.1
# via cryptography
cryptography==43.0.1
# via secretstorage
h11==0.14.0
# via httpcore
html5lib==1.1
Expand All @@ -35,10 +31,6 @@ jaraco-context==5.3.0
# via keyring
jaraco-functools==4.0.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.5
# via -r requirements.in
keyring==25.6.0
Expand All @@ -53,10 +45,6 @@ more-itertools==10.1.0
# jaraco-functools
pillow==11.1.0
# via -r requirements.in
pycparser==2.22
# via cffi
secretstorage==3.3.3
# via keyring
six==1.16.0
# via html5lib
sniffio==1.3.0
Expand Down
22 changes: 22 additions & 0 deletions scripts/upload_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# This script will upload the contents of the local _html folder
# to my web server.
#
# Any arguments passed to this script will be passed to the underlying
# rsync command.

set -o errexit
set -o nounset
set -o xtrace

rsync \
--compress \
--archive \
--recursive \
--delete \
--verbose \
--include="" \
--filter="" \
"_html/" \
"[email protected]:repos/library-lookup/_html/" \
"$@"