add nginx

This commit is contained in:
uetchy 2021-06-08 16:50:52 +09:00
parent 4e9aacfab8
commit 8b0111450b
11 changed files with 149 additions and 11 deletions

61
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,61 @@
# https://hexo.io/docs/github-pages.html
name: Docker
on:
push:
branches:
- source # default branch
jobs:
pages:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc -y
- name: Use Node.js 15.x
uses: actions/setup-node@v1
with:
node-version: "15.x"
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/uetchy/uechi.io:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM nginx:stable-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY public /var/www/html/

View File

@ -5,6 +5,7 @@
## Build ## Build
``` ```
n 15
yarn build yarn build
``` ```

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: "3"
services:
web:
image: ghcr.io/uetchy/uechi.io
build: .
ports:
- "8080:80"

46
nginx.conf Normal file
View File

@ -0,0 +1,46 @@
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
root /var/www/html;
error_page 404 /404.html;
location /404.html {
internal;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
index index.html;
try_files $uri $uri.html $uri/index.html =404;
}
location = / {
if ($http_user_agent ~ curl) {
rewrite / /TERMINAL last;
}
}
}
}

View File

@ -39,4 +39,4 @@
"version": "5.4.0" "version": "5.4.0"
}, },
"private": true "private": true
} }

8
source/TERMINAL Normal file
View File

@ -0,0 +1,8 @@
░█░█░█▀▀░█▀▀░█░█░▀█▀░░░░▀█▀░█▀█
░█░█░█▀▀░█░░░█▀█░░█░░░░░░█░░█░█
░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░░▀▀▀░▀▀▀
GitHub: https://github.com/uetchy
Twitter: https://twitter.com/uechz
Wallpaper: https://uechi.io/wallpaper

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2019 snovey Copyright (c) 2021 Yasuaki Uechi <y@uechi.io>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,11 +1,15 @@
<section> <section>
<article class="article"> <article class="article">
<hgroup class="article__metadata"> <hgroup class="article__metadata">
<% if (page.date) { %> <% if (page.updated) { %>
<h3 class="article__pubdate"> <h3 class="article__pubdate">
<time pubdate><%- date(page.date, "YYYY-MM-DD") %></time> <time pubdate><%- date(page.updated, "YYYY / <b>MM</b>") %></time>
</h3> </h3>
<% } %> <% } else if (page.date) { %>
<h3 class="article__pubdate">
<time pubdate><%- date(page.date, "YYYY / <b>MM</b>") %></time>
</h3>
<% } %>
<h2 class="article__title"><%- page.title %></h2> <h2 class="article__title"><%- page.title %></h2>
</hgroup> </hgroup>
<div class="article__content"><%- page.content %></div> <div class="article__content"><%- page.content %></div>

View File

@ -9,6 +9,7 @@ $break-large: 840px;
--accent: #4f33e8; --accent: #4f33e8;
--highlight: #f6f6f6; --highlight: #f6f6f6;
--tone: #989898; --tone: #989898;
--dim: rgb(203, 203, 203);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
@ -18,6 +19,7 @@ $break-large: 840px;
--accent: #7033e8; --accent: #7033e8;
--highlight: #140d25; --highlight: #140d25;
--tone: #989898; --tone: #989898;
--dim: rgb(90, 83, 101);
} }
} }
@ -33,7 +35,7 @@ body {
font-family: "PT Sans", "Hiragino Sans", "Hiragino Mincho ProN", sans-serif; font-family: "PT Sans", "Hiragino Sans", "Hiragino Mincho ProN", sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
font-feature-settings: "kern", "palt", "pwid"; font-feature-settings: "kern", "pwid";
-webkit-font-feature-settings: "kern", "palt", "pwid"; -webkit-font-feature-settings: "kern", "palt", "pwid";
-moz-font-feature-settings: "kern", "palt", "pwid"; -moz-font-feature-settings: "kern", "palt", "pwid";
-moz-font-feature-settings: "kern=1", "palt", "pwid"; -moz-font-feature-settings: "kern=1", "palt", "pwid";

View File

@ -89,14 +89,17 @@ a.article-list__item__button {
.article__pubdate { .article__pubdate {
color: var(--tone); color: var(--tone);
font-size: 14px; font-size: 18px;
font-weight: lighter; font-weight: 300;
font-family: sans-serif;
margin-bottom: 10px; margin-bottom: 10px;
border: 1px solid var(--tone); border: 1px solid var(--tone);
display: inline-block; display: inline-block;
padding: 5px 20px; padding: 5px 20px;
b {
font-weight: 700;
}
@media screen and (max-width: $break-small) { @media screen and (max-width: $break-small) {
margin-bottom: 15px; margin-bottom: 15px;
font-size: 10pt; font-size: 10pt;