-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
425 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/// <reference path="https://raw.githubusercontent.com/syfxlin/depker/master/src/types/index.ts" /> | ||
|
||
export const deploy = depker.docker.of(() => ({ | ||
name: "blog", | ||
image: "syfxlin/blog", | ||
build: { | ||
secret: { build: ".env" }, | ||
dockerfile_contents: depker.template.nodejs_static({ | ||
version: "node16", | ||
// prettier-ignore | ||
inject_prepare: [`RUN apk --no-cache add git \ | ||
shadow \ | ||
gcc \ | ||
musl-dev \ | ||
autoconf \ | ||
automake \ | ||
make \ | ||
libtool \ | ||
nasm \ | ||
tiff \ | ||
jpeg \ | ||
zlib \ | ||
zlib-dev \ | ||
file \ | ||
pkgconf \ | ||
util-linux \ | ||
g++ \ | ||
make \ | ||
python3 | ||
`] | ||
}) | ||
}, | ||
run: { | ||
traefik: { | ||
domain: ["blog.ixk.me"], | ||
tls: true | ||
} | ||
} | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
location ~ ^\/(?<post>[^\/]+)\.html$ { | ||
try_files $uri $uri/ @redirect_to_post; | ||
} | ||
|
||
location @redirect_to_post { | ||
return 301 $scheme://$host/post/$post/; | ||
} | ||
|
||
location ~ ^\/(?<year>\d\d\d\d)\/\d\d { | ||
try_files $uri $uri/ @redirect_to_archive; | ||
} | ||
|
||
location @redirect_to_archive { | ||
return 301 $scheme://$host/archive/$year/; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# ========================= | ||
# Node.js-Specific Ignores | ||
# ========================= | ||
|
||
# Build directory | ||
public/ | ||
|
||
# Gatsby cache | ||
.cache/ | ||
src/gatsby-types.d.ts | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# ========================= | ||
# Operating System Files | ||
# ========================= | ||
|
||
# OSX | ||
# ========================= | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear on external disk | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Windows | ||
# ========================= | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# Editor | ||
.vscode | ||
.idea | ||
|
||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
GATSBY_GOOGLE_ANALUTICS_ID= | ||
GATSBY_ALGOLIA_APP_ID= | ||
GATSBY_ALGOLIA_API_KEY= | ||
GATSBY_ALGOLIA_INDEX_NAME= | ||
GATSBY_ARTALK_SERVER_URL= | ||
GATSBY_ARTALK_SITE_NAME= | ||
# private | ||
ALGOLIA_ADMIN_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Gatsby Deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/syfxlin/depker:master | ||
env: | ||
TZ: Asia/Shanghai | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Deploy to docker | ||
run: | | ||
export DOCKER_HOST=${{ secrets.DOCKER_HOST }} | ||
export DOCKER_TLS_VERIFY=1 | ||
mkdir -p ~/.docker | ||
echo "$CA_PEM" > ~/.docker/ca.pem | ||
echo "$CERT_PEM" > ~/.docker/cert.pem | ||
echo "$KEY_PEM" > ~/.docker/key.pem | ||
echo "$SECRET_ENV" > .env | ||
depker do deploy up -f .depker/depker.ts | ||
env: | ||
CA_PEM: ${{ secrets.CA_PEM }} | ||
CERT_PEM: ${{ secrets.CERT_PEM }} | ||
KEY_PEM: ${{ secrets.KEY_PEM }} | ||
SECRET_ENV: ${{ secrets.SECRET_ENV }} |
Oops, something went wrong.