Skip to content

Commit

Permalink
feat: wip mvp
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWennrich committed Oct 14, 2024
0 parents commit 64e565e
Show file tree
Hide file tree
Showing 18 changed files with 1,965 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI/CD Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"

- name: "Validate Composer"
run: "composer validate"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- name: "Test"
run: "composer test"

- name: "Build"
run: "make"

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: "build"

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
/.idea/
/build/
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build-page:
$(MAKE) clean
mkdir build
php generate-html.php > build/index.html
cp -r assets/* build/
clean:
rm -rf build
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Jan's Boardgames 🎲

This is a static site generator for my boardgames hobby.

The `generate-html.php` script reads the [Board Game Geek XML API](https://boardgamegeek.com/wiki/page/BGG_XML_API2) to retrieve my profile data and generates an HTML file.

GitHub Actions are used to deploy the static site.

## Usage

1. Run `composer install`
2. Run `make`
3. Open `build/index.html` in your browser

(The deployment to GitHub pages is handled by the GitHub action in `.github/workflows/pages.yml`)
Binary file added assets/fonts/Oswald-VariableFont_wght.ttf
Binary file not shown.
Empty file added assets/script.js
Empty file.
24 changes: 24 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:root {
--font-size: 16px;
--color-background: #242629;
--color-background-darkened: #16161a;
--color-headline: #fffffe;
--color-paragraph: #94a1b2;
--color-button: #7f5af0;
--color-button-text: #fffffe;
--color-highlight: #7f5af0;
--color-secondary: #72757e;
--color-tertiary: #2cb67d;
}

@font-face {
font-family: Oswald;
src: url('fonts/Oswald-VariableFont_wght.ttf');
}

body {
background-color: var(--color-background);
color: var(--color-paragraph);
font-family: "Oswald", sans-serif;
font-size: var(--font-size);
}
13 changes: 13 additions & 0 deletions captainhook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
},
{
"action": "composer test"
}
]
}
}
36 changes: 36 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "janwennrich/boardgames",
"description": "Static site generator for my boardgames hobby",
"type": "project",
"require": {
"php": "^8.2",
"php-di/php-di": "^7.0.7",
"twig/twig": "^3.14.0",
"nataniel/bggxmlapi2": "^1.1.5"
},
"require-dev": {
"captainhook/captainhook": "^5.23.5",
"phpstan/phpstan": "^1.12.3",
"squizlabs/php_codesniffer": "^3.10.2"
},
"autoload": {
"psr-4": {
"JanWennrich\\BoardGames\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"JanWennrich\\BoardGames\\": "tests/"
}
},
"minimum-stability": "stable",
"config": {
"sort-packages": true
},
"scripts": {
"test": [
"vendor/bin/phpstan",
"vendor/bin/phpcs"
]
}
}
Loading

0 comments on commit 64e565e

Please sign in to comment.