Update workflow

This commit is contained in:
Ryan Freeman 2024-08-23 22:46:33 +01:00
parent c0db78e6b4
commit 66eea98efc
3 changed files with 43 additions and 12 deletions

View File

@ -38,18 +38,15 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1 tags: ${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
- name: Stop the docker container - name: Stop and remove old Docker container
continue-on-error: true continue-on-error: true
run: sudo docker stop portfolio run: |
sudo docker stop ${{vars.REPO_NAME}}
sudo docker rm ${{vars.REPO_NAME}}
- name: Remove the docker container - name: Pull new image and start Docker container
continue-on-error: true run: |
run: sudo docker rm portfolio sudo docker pull ${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
sudo docker run -d --restart unless-stopped --env-file ./.env --name portfolio -p ${{vars.DEPLOY_IP}}:3000:3000 ${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
- name: Pull the Docker image
run: sudo docker pull ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1
- name: Run the Docker container
run: sudo docker run -d --restart unless-stopped --env-file ./.env --name portfolio -p ${{vars.TAILSCALE_IP}}:3000:3000 ${{secrets.DOCKER_HUB_USERNAME}}/portfolio:v1

View File

@ -0,0 +1,34 @@
import {ArticleLayout} from '../../../components/layouts/ArticleLayout'
import {createSlug} from '../../../lib/createSlug'
import raspberryPi from './vishnu-mohanan-rZKdS0wI8Ks-unsplash.jpg'
import Image from 'next/image';
export const metadata = {
authors: 'Ryan Freeman',
title: 'Migrating from Vercel to Raspberry Pi 5',
date: '2024-08-23',
description: 'Recently, I decided to migrate this website from Vercel to a self-hosted environment using a Raspberry Pi 5. This transition was driven by several motivations, such as lowering costs and having greater control over the software and hardware that I run.'
}
export default (props) => <ArticleLayout
title={metadata.title}
date={metadata.date}
description={metadata.description}
slug={createSlug(metadata.title)}
{...props} />
<Image src={raspberryPi} alt=""/>
Recently, I decided to migrate this website from Vercel to a self-hosted environment using a Raspberry Pi 5. This transition was driven by several motivations, such as lowering costs and having greater control over the software and hardware that I run.
## The Why: Leaving Vercel behind
Don't get me wrong, the developer experience with Vercel is in my opinion second to none. Push code and forget about it, while Vercel automagically deploys your apps. Vercel abstracts all the complicated CI/CD processes behind a nice UI and takes care of everything under the hood.
However, I wanted to explore a more hands-on approach, one that would give me more control over my deployment process and for this I needed a new home for my website.
## The Hardware
The Raspberry Pi 5 seemed like the perfect solution to run my website from. It's a powerful little device, cheap to run and since I'm already running a small media server on another Pi, I was at least somewhat familiar how to set everything up.
I wanted fast and reliable storage so that websites and apps I'm going to deploy would be responsive. I settled on this [Geeekpi NVMe adapter](https://amzn.to/3yH64bf) and [Kingston 500GB NVMe](https://amzn.to/4g07NsI) which had sufficient storage capacity for my needs.

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 KiB