Skip to content

Commit

Permalink
Init skeleton content
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Nov 2, 2022
1 parent 8e8ae95 commit c780e50
Show file tree
Hide file tree
Showing 115 changed files with 26,562 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.{php,html,twig}]
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 4

[*.md]
max_line_length = 120
trim_trailing_whitespace = false

[*.js]
indent_style = space
indent_size = 2

[*.scss]
indent_style = space
indent_size = 2

[COMMIT_EDITMSG]
max_line_length = 0
27 changes: 27 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=01GCH9K4QD0WZXA4MSK4BVDM50
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
ROUTER_DEFAULT_URI=http://localhost
###< symfony/framework-bundle ###

###> app ###
GLIDE_PRE_GENERATE_CACHE=0
###< app ###
5 changes: 5 additions & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###> app ###
# We want to pre-generate the resized images cache in prod env,
# in order to make them available in the static build version of the site:
GLIDE_PRE_GENERATE_CACHE=1
###< app ###
4 changes: 4 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:json/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4,
{ "SwitchCase": 1 }
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-console": [
"error",
{ "allow": ["info", "error"] }
]
}
}
2 changes: 2 additions & 0 deletions .github/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.{yml,yaml}]
indent_size = 2
92 changes: 92 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Deploy to GH Pages

on:
workflow_dispatch: ~
push:
branches:
- main

jobs:

deploy:
name: '🚧 Build & deploy 🚀'
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Setup node'
uses: actions/setup-node@v2
with:
node-version: '16'

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
coverage: "none"
ini-values: "memory_limit=-1"
php-version: "8.1"

- name: 'Determine composer cache directory'
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"

- name: 'Cache composer dependencies'
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: composer-${{ hashFiles('composer.lock') }}

- name: 'Cache resized images'
uses: actions/cache@v2
with:
path: public/resized
key: resized-images-${{ secrets.CACHE_VERSION }}

- name: 'Cache NPM dependencies'
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('package-lock.json') }}

- name: 'Install dependencies'
run: |
echo "::group::composer install"
composer install --no-progress --ansi
echo "::endgroup::"
echo "::group::npm install"
npm install --color=always --no-progress --no-audit
echo "::endgroup::"
- name: 'Warmup'
run: |
echo "::group::warmup production env"
npx encore production --color
bin/console cache:clear --ansi
bin/console cache:warmup --ansi
echo "::endgroup::"
env:
NODE_ENV: production
APP_ENV: prod
WEBPACK_PUBLIC_PATH: /${{ github.event.repository.name }}/build

- name: 'Build static site'
run: bin/console stenope:build --no-interaction -vvv --ansi
env:
APP_ENV: prod
# Replace with your GH Pages URL:
ROUTER_DEFAULT_URI: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}

# https://github.com/marketplace/actions/deploy-to-github-pages
- name: '🚀 Deploy'
uses: JamesIves/[email protected]
with:
COMMIT_MESSAGE: "[AUTO] Static site update for ${{ github.sha }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
CLEAN_EXCLUDE: '["CNAME", ".nojekyll"]' # Don't clean CNAME file for custom domain nor .nojekyll file to disable Jekyll on Github Pages
115 changes: 115 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Tests

on:
workflow_dispatch: ~
push:
branches:
- main
pull_request:

jobs:

tests:
name: 'Tests'
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Setup node'
uses: actions/setup-node@v2
with:
node-version: '16'

- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
coverage: "none"
ini-values: "memory_limit=-1"
php-version: "8.1"
tools: symfony

- name: 'Determine composer cache directory'
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"

- name: 'Cache composer dependencies'
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: composer-${{ hashFiles('composer.lock') }}

- name: 'Cache resized images'
uses: actions/cache@v2
with:
path: public/resized
key: resized-images-tests-${{ secrets.CACHE_VERSION }}

- name: 'Cache blurhash images'
uses: actions/cache@v2
with:
path: var/cache/pools/app
key: resized-blurhash-tests-${{ secrets.CACHE_VERSION }}

- name: 'Install dependencies'
id: deps
run: |
echo "::group::composer install"
composer install --no-progress --ansi
echo "::endgroup::"
# echo "::group::install phpunit"
# vendor/bin/simple-phpunit install
# echo "::endgroup::"
echo "::group::npm install"
npm install --color=always --no-progress --no-audit
echo "::endgroup::"
- name: 'Warmup'
run: |
bin/console cache:clear --ansi --no-warmup
bin/console cache:warmup --ansi
env:
APP_ENV: test

- name: 'Composer validate'
if: always() && steps.deps.outcome == 'success'
run: composer validate --no-check-publish

- name: 'Lint YAML'
if: always() && steps.deps.outcome == 'success'
run: make lint.yaml@integration

- name: 'Lint Twig'
if: always() && steps.deps.outcome == 'success'
run: make lint.yaml@integration

- name: 'Lint JS'
if: always() && steps.deps.outcome == 'success'
run: make lint.eslint@integration

- name: 'Lint Parameters and Services'
if: always() && steps.deps.outcome == 'success'
run: make lint.container@integration

- name: 'PHP CS Fixer'
if: always() && steps.deps.outcome == 'success'
run: make lint.php-cs-fixer@integration

- name: 'PhpStan'
if: always() && steps.deps.outcome == 'success'
run: make lint.phpstan@integration

# - name: Run tests
# run: vendor/bin/simple-phpunit --testdox

- name: 'Check build static'
run: |
npx encore production --color
bin/console stenope:build --no-interaction -vvv --ansi
env:
APP_ENV: prod
NODE_ENV: production
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

/build/

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> glide ###
/public/resized
###< glide ###
Loading

0 comments on commit c780e50

Please sign in to comment.