Skip to content

Commit

Permalink
Merge pull request #1 from holysoles/dev
Browse files Browse the repository at this point in the history
add docs and build action
  • Loading branch information
holysoles authored Mar 22, 2024
2 parents a2bc2f2 + 4da87b3 commit bd98dc0
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/image_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and release Docker image

on:
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
# perms for token
permissions:
contents: read
packages: write
steps:
- name: checkout repo
uses: actions/[email protected]
- name: container registry auth
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: generate tags, label
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: image build and push
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# portfolio-site
Website to highlight personal projects, written in Python, built on Flask and Jinja templating.

## YAML-based posts

Individual project posts to the home page are defined via yaml files, with support for proper HTML tags (headings and subheadings, paragraph text, divs, and more) in addition to inline code snippets and images.

I chose this approach as an introduction to working with Flask and to leverage Jinja templates in a way I haven't seen before. This project design allows to me to maintain the site without needing a more complex solution for blog post entries, such as a database.

## Docker
### Image
A docker image that runs this application is available under the repo packages, or at `ghcr.io/holysoles/portfolio-site`.
### Compose
An example compose file can be found in the repo [here](https://github.com/holysoles/portfolio-site/blob/master/compose.yaml)
### Building
`docker build --tag ghcr.io/holysoles/portfolio-site:<tag> .`
### Testing
`docker run --rm -d -p 5000:5000 ghcr.io/holysoles/portfolio-site:<tag>`
### Upload
`docker push ghcr.io/holysoles/portfolio-site:<tag>`
11 changes: 11 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.9'
services:
site:
image: ghcr.io/holysoles/portfolio-site:latest
ports:
- "5000:5000/tcp"
deploy:
mode: replicated
replicas: 2
update_config:
delay: 30s

0 comments on commit bd98dc0

Please sign in to comment.