Skip to content

Commit

Permalink
Expand the website
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrybig committed May 17, 2024
1 parent 2a7d3b1 commit f8b2d96
Show file tree
Hide file tree
Showing 68 changed files with 6,377 additions and 13,939 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ indent_style = tab
indent_size = 4
[*.{yml,md}]
indent_style = space
indent_size = 4
indent_size = 2
[package.json]
indent_style = space
indent_size = 2
Expand Down
124 changes: 68 additions & 56 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,75 @@
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:react/recommended
- plugin:react/jsx-runtime
- next/core-web-vitals
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:react/recommended
- plugin:react/jsx-runtime
- next/core-web-vitals
ignorePatterns:
- tmp
- dist
- "**/lib/*.js"
- out
- app/*.js
- md-compiler/out/*.js
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
- "@typescript-eslint"
rules:
no-shadow: off
"@typescript-eslint/no-shadow":
- error
no-use-before-define: off
"@typescript-eslint/no-use-before-define":
- error
react/jsx-filename-extension:
- warn
- extensions:
- .tsx
react/jsx-key:
- off
quotes:
- warn
- single
indent:
- warn
- tab
- flatTernaryExpressions: true
react/forbid-component-props:
- error
- forbid:
- key
"@typescript-eslint/no-explicit-any":
- off
semi:
- warn
- always
no-trailing-spaces:
- warn
comma-dangle:
- warn
- always-multiline
space-before-blocks:
- warn
- always
keyword-spacing:
- warn
- before: true
after: true
jsx-quotes:
- warn
- prefer-double
no-shadow: off
"@typescript-eslint/no-shadow":
- error
no-use-before-define: off
"@typescript-eslint/no-use-before-define":
- error
react/jsx-filename-extension:
- warn
- extensions:
- .tsx
react/jsx-key:
- off
quotes:
- warn
- single
indent:
- warn
- tab
- flatTernaryExpressions: true
react/forbid-component-props:
- error
- forbid:
- key
"@typescript-eslint/no-explicit-any":
- off
semi:
- warn
- always
no-trailing-spaces:
- warn
comma-dangle:
- warn
- always-multiline
space-before-blocks:
- warn
- always
keyword-spacing:
- warn
- before: true
after: true
jsx-quotes:
- warn
- prefer-double
"@next/next/no-img-element":
- off
react/forbid-elements:
- error
- forbid:
- img
"@typescript-eslint/no-restricted-imports":
- error
- name: "next/image"
message: "Please change the import to `@/_components/Image`"
"allowTypeImports": true
- "path"
env:
browser: true
browser: true
settings:
react:
pragma: React
version: '17.0'
react:
pragma: React
version: "17.0"
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run tests
on:
workflow_call:
push:
branches-ignore:
- $default-branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fix timestamps
run: bash .github/scripts/fix-timestamps
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
#- uses: actions/cache@v4
# with:
# path: |
# ${{ github.workspace }}/.next/cache
# # Generate a new cache whenever packages or source files change.
# key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# # If source files changed but packages didn't, rebuild from a prior cache.
# restore-keys: |
# ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: .
target: export
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
outputs: type=local,dest=/tmp/files
tags: www.ferrybig.me:latest
env:
SOURCE_DATE_EPOCH: 0
- name: Move cache
if: github.event_name == 'push'
run:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: files
path: /tmp/files
73 changes: 24 additions & 49 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,28 @@

name: Deploy app
on:
push:
branches: [$default-branch]
workflow_dispatch:
push:
branches: [$default-branch]
workflow_dispatch:
jobs: # push, pull_request
tests:
uses: ./.github/workflows/test.yml
build:
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fix timestamps
run: bash .github/scripts/fix-timestamps
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm run build
- name: CompressFiles
uses: stefh/ghaction-CompressFiles@v2
with:
path: dist
extensions: ".js,.css,.html,.map,.stl,.xml,.scad,.svg,.txt,.bmp"
tools: "brotli,gzip"
deterministicCompression: true
- name: ssh publish
uses: easingthemes/ssh-deploy@c711f2c3391cac2876bf4c833590077f02e4bcb8
with:
SSH_PRIVATE_KEY: ${{ secrets.ssh_private_key }}
REMOTE_HOST: ${{ secrets.ssh_host }}
REMOTE_USER: ${{ secrets.ssh_user }}
REMOTE_PORT: 22
SOURCE: out/
TARGET: ${{ secrets.ssh_target }}
ARGS: -r -l -0 -v --checksum --delete-delay
tests:
uses: ./.github/workflows/build.yml
deploy:
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: files
path: /tmp
- name: ssh publish
uses: easingthemes/ssh-deploy@c711f2c3391cac2876bf4c833590077f02e4bcb8
with:
SSH_PRIVATE_KEY: ${{ secrets.ssh_private_key }}
REMOTE_HOST: ${{ secrets.ssh_host }}
REMOTE_USER: ${{ secrets.ssh_user }}
REMOTE_PORT: 22
SOURCE: /tmp/files
TARGET: ${{ secrets.ssh_target }}
ARGS: -r -l -0 -v --checksum --delete-delay
33 changes: 0 additions & 33 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"estree",
"ferrybig",
"gifsicle",
"goatcounter",
"hljs",
"jpegtran",
"jsxs",
Expand Down
Loading

0 comments on commit f8b2d96

Please sign in to comment.