-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from holysoles/dev
add docs and build action
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |