Skip to content

Commit

Permalink
added gh action for package build, update some build definitions and …
Browse files Browse the repository at this point in the history
…fixed some small issues
  • Loading branch information
harmoniemand committed Feb 16, 2024
1 parent 654dcd9 commit 7870388
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 41 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: GHCR Latest

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/${{ github.repository }}:build-${{github.run_number}}

- name: Image digest
run: echo ${{ steps.build-and-push.outputs.digest }}
34 changes: 23 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM jekyll/jekyll:builder
# STAGE: Builder

FROM jekyll/jekyll:builder as builder

WORKDIR /cfhn

COPY . /cfhn/

RUN chmod -R 777 /cfhn
RUN gem install public_suffix
# RUN gem install jekyll
# RUN gem install jekyll-seo-tag
# RUN gem install jekyll-sitemap
# RUN gem install jekyll-redirect-from
# RUN gem install jekyll-feed
# RUN gem install tzinfo-data

# RUN gem install bundler
RUN bash -c "bundle install"
RUN bash -c "bundle exec jekyll build"

# RUN apt update -y && \
# apt install -y software-properties-common && \
# apt-add-repository ppa:brightbox/ruby-ng && \
# apt update -y && \
# apt install -y ruby2.7 ruby2.7-dev build-essential autoconf libcurl3-gnutls libcurl3-nss && \
# gem install -f ffi && \
# gem install jekyll bundler
# RUN bundle config --global silence_root_warning 1
WORKDIR /cfhn
CMD ["bash", "-c", "bundle install && bundle exec jekyll serve --host 0.0.0.0"]


# STAGE: Production

FROM nginx:alpine as production
COPY --from=builder /cfhn/_site/ /usr/share/nginx/html/
15 changes: 15 additions & 0 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM jekyll/jekyll:builder

RUN gem install public_suffix


# RUN apt update -y && \
# apt install -y software-properties-common && \
# apt-add-repository ppa:brightbox/ruby-ng && \
# apt update -y && \
# apt install -y ruby2.7 ruby2.7-dev build-essential autoconf libcurl3-gnutls libcurl3-nss && \
# gem install -f ffi && \
# gem install jekyll bundler
# RUN bundle config --global silence_root_warning 1
WORKDIR /cfhn
CMD ["bash", "-c", "bundle install && bundle exec jekyll serve --host 0.0.0.0"]
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
# codeforheilbronn-de

## Wie kann ich beitragen?
This repository contains the source code for the website of Code for Heilbronn e.V. (https://codeforheilbronn.de).

### Blogbeitrag schreiben
## How to support?

Um einen neuen Blogbeitrag zu schreiben, lege dir zuerst einen neuen Branch an. Das Namensschema für Blogbeiträge ist "blog/[year]-[month]-[day]-[title]
### Writing a blog post

Der neue Blogbeitrag wird dann als neue Markdown-File unter '\_posts' abgelegt.
Wenn du Bilder etc in deinen Beitrag einbinden möchtest, kannst du diese unter 'uploads/post_media' ablegen. Bei einzelnen Bildern, kannst du das Bild direkt in den Ordner legen. Wenn du mehrere Bilder hast, lege bitte einen neuen Ordner an und nenne ihn genau wie die Markdown-Datei (nur ohne .md).
To write a new blog post, first create a new branch. The naming scheme for blog posts is "blog/[year]-[month]-[day]-[title]

### Projekt veröffentlichen
Create a new file under '\_posts' with the following naming scheme: [year]-[month]-[day]-[title].md

Wenn du ein Projekt auf der Website veröffentlichen willst, dann lege dir zuerst einen neuen Branch an. Das Namensschema für Projekte ist "project/[year]-[month]-[day]-[title]
Lege dir, für dein Projekt, einen neuen Eintrag unter '\_projects' an. Die Bilder für Projekte werden in 'uploads/\_prj_media' abgelegt. Das Vorgehen ist wie bei Blogeinträgen.
If you want to include images etc in your post, you can put them under 'uploads/post_media'. For individual images, you can put the image directly into the folder. If you have multiple images, please create a new folder and name it exactly like the markdown file (without .md).

### Änderungen am Layout / allgemeine neue Features
### Publishing a project

Das Namensschema für neue Features ist "feature/[title]
If you want to publish a project on the website, first create a new branch. The naming scheme for projects is "project/[year]-[month]-[day]-[title]
Create a new file under '\_projects' with the following naming scheme: [year]-[month]-[day]-[title].md
Images for projects are stored in 'uploads/\_prj_media'. The procedure is the same as for blog posts.

### Changing the layout / general new features

## Getting Started
If ruby and the gem bundler is installed, run `bundle install` to install all further dependencies

To host the site locally run `bundle exec jekyll serve`
If you want to change the layout or add new features, please create a new branch. The naming scheme for new features is "feature/[title]

## JekyllWorkshop

sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.5 ruby2.5-dev build-essential autoconf libcurl3
sudo gem install -f ffi
sudo gem install jekyll bundler
git clone https://github.com/opendata-heilbronn/codeforheilbronn-de
cd codeforheilbronn-de
bundle install
bundle exec jekyll serve
## Getting Started

oder alternativ mit Docker
hosting a local development server, just use the following command:

docker build -t cfhn/cfhn-dev .
docker run -v $PWD:/cfhn -p 4000:4000 cfhn/cfhn-dev
docker-compose up
2 changes: 2 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<head>
<!-- General meta -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">


{% if page.indexing == false %}
<meta name="robots" content="noindex">
Expand Down
4 changes: 2 additions & 2 deletions _posts/2024-03-02-odd24.md → _posts/2024-02-14-odd24.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ tags: [hackathon]
feature_image: /uploads/post_media/open-data-day-header-online.jpg
published: true
category: Einladung
registration: https://pretix.cfhn.it/cfhn/odd24/
date: 2023-02-24
date: 2024-02-14
excerpt: "Der Open Data Day ist ein weltweites Festival für Offene Daten. Wir veranstalten am 2. und 3. März hierzu einen Hackathon."
author: joni
# registration: https://pretix.cfhn.it/cfhn/odd24/
---
(English Version down below)

Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ version: '3.8'
services:
jekyll_dev:
# image: jekyll/jekyll:builder
build: .
build:
context: .
dockerfile: Dockerfile.develop

volumes:
- ./:/cfhn
ports:
Expand Down
Binary file modified uploads/post_media/open-data-day-header-online.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7870388

Please sign in to comment.