ci: 完善部署。
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ivan Li 2022-10-09 14:44:32 +08:00
parent bcdc4ce087
commit 7591d486f5
4 changed files with 69 additions and 63 deletions

View File

@ -1,6 +1,6 @@
--- ---
kind: pipeline kind: pipeline
name: base name: deps
type: docker type: docker
steps: steps:
@ -12,11 +12,11 @@ steps:
from_secret: ivan-docker-username from_secret: ivan-docker-username
password: password:
from_secret: ivan-docker-password from_secret: ivan-docker-password
repo: docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base repo: docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-deps
cache_from: cache_from:
- docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base:${DRONE_BRANCH}${DRONE_TAG}-amd64 - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-deps:${DRONE_BRANCH}${DRONE_TAG}-amd64
dockerfile: Dockerfile dockerfile: Dockerfile
target: base target: deps
tags: tags:
- '${DRONE_COMMIT_SHA:0:8}-amd64' - '${DRONE_COMMIT_SHA:0:8}-amd64'
- '${DRONE_BRANCH}${DRONE_TAG}-amd64' - '${DRONE_BRANCH}${DRONE_TAG}-amd64'
@ -57,7 +57,7 @@ kind: pipeline
name: linux-amd64 name: linux-amd64
type: docker type: docker
depends_on: depends_on:
- base - deps
steps: steps:
- name: build&publish - name: build&publish
@ -72,8 +72,7 @@ steps:
dockerfile: Dockerfile dockerfile: Dockerfile
target: release target: release
cache_from: cache_from:
- docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base:${DRONE_BRANCH}${DRONE_TAG}-amd64 - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-deps:${DRONE_BRANCH}${DRONE_TAG}-amd64
- docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog:${DRONE_BRANCH}${DRONE_TAG}-amd64
tags: tags:
- '${DRONE_COMMIT_SHA:0:8}' - '${DRONE_COMMIT_SHA:0:8}'
- '${DRONE_BRANCH}${DRONE_TAG}' - '${DRONE_BRANCH}${DRONE_TAG}'

View File

@ -1,15 +1,22 @@
FROM node:16-alpine as base FROM node:16-alpine as base
RUN npm i --location=global pnpm@7
FROM base as deps
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
COPY pnpm-lock.yaml package.json ./ COPY pnpm-lock.yaml package.json ./
RUN npm i --location=global pnpm@7 &&\ RUN pnpm i
pnpm i
FROM deps as build
WORKDIR /app
COPY . . COPY . .
COPY --from=deps /app ./
RUN pnpm build &&\ RUN pnpm build &&\
pnpm prune --prod --config.ignore-scripts=true pnpm prune --prod --config.ignore-scripts=true
FROM node:16-alpine as release FROM node:16-alpine as release
WORKDIR /app WORKDIR /app
COPY --from=base /app ./ COPY --from=build /app ./
EXPOSE 80 EXPOSE 80
CMD npm run serve -- -p 80 CMD npm run serve -- -p 80

View File

@ -24,7 +24,7 @@
"image-size": "1.0.0", "image-size": "1.0.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"mdx-bundler": "^8.0.0", "mdx-bundler": "^8.0.0",
"next": "12.2.1", "next": "=12.2.0",
"next-themes": "^0.0.14", "next-themes": "^0.0.14",
"postcss": "^8.4.5", "postcss": "^8.4.5",
"preact": "^10.6.2", "preact": "^10.6.2",

View File

@ -30,7 +30,7 @@ specifiers:
js-yaml: ^4.1.0 js-yaml: ^4.1.0
lint-staged: ^11.0.0 lint-staged: ^11.0.0
mdx-bundler: ^8.0.0 mdx-bundler: ^8.0.0
next: 12.2.1 next: '=12.2.0'
next-remote-watch: ^1.0.0 next-remote-watch: ^1.0.0
next-themes: ^0.0.14 next-themes: ^0.0.14
postcss: ^8.4.5 postcss: ^8.4.5
@ -73,8 +73,8 @@ dependencies:
image-size: 1.0.0 image-size: 1.0.0
js-yaml: 4.1.0 js-yaml: 4.1.0
mdx-bundler: 8.1.0_esbuild@0.13.15 mdx-bundler: 8.1.0_esbuild@0.13.15
next: 12.2.1_sfoxds7t5ydpegc3knd667wn6m next: 12.2.0_sfoxds7t5ydpegc3knd667wn6m
next-themes: 0.0.14_hd4ftj27eynthkwnbwxec6joby next-themes: 0.0.14_nsrodebypp3mcf7ihyfjqmpudu
postcss: 8.4.17 postcss: 8.4.17
preact: 10.11.1 preact: 10.11.1
react: 17.0.2 react: 17.0.2
@ -107,7 +107,7 @@ devDependencies:
cross-env: 7.0.3 cross-env: 7.0.3
dedent: 0.7.0 dedent: 0.7.0
eslint: 7.32.0 eslint: 7.32.0
eslint-config-next: 12.0.9_apni7ptlphdqoi2rt7ovvz6r34 eslint-config-next: 12.0.9_axmrhsq5bdxho664wwmmqxhkji
eslint-config-prettier: 8.5.0_eslint@7.32.0 eslint-config-prettier: 8.5.0_eslint@7.32.0
eslint-plugin-prettier: 3.4.1_7gsvg5lgwpfdww3i7smtqxamuy eslint-plugin-prettier: 3.4.1_7gsvg5lgwpfdww3i7smtqxamuy
file-loader: 6.2.0 file-loader: 6.2.0
@ -1570,8 +1570,8 @@ packages:
- utf-8-validate - utf-8-validate
dev: false dev: false
/@next/env/12.2.1: /@next/env/12.2.0:
resolution: {integrity: sha512-lz3TJKIvbdGRUsUr/+h3vy7XvBNGTGzHwhurk5AtqrABj4Zyo70xbshcI7YQTNUK4x9OA/E+SOcXvVx0DHmFRw==} resolution: {integrity: sha512-/FCkDpL/8SodJEXvx/DYNlOD5ijTtkozf4PPulYPtkPOJaMPpBSOkzmsta4fnrnbdH6eZjbwbiXFdr6gSQCV4w==}
/@next/eslint-plugin-next/12.0.9: /@next/eslint-plugin-next/12.0.9:
resolution: {integrity: sha512-Pi7eV7Omt4wkY1UI9Kvv3KQLvAkmWKb5EHePCE1fyR+LeYmKCNYtjVst3QTDkNeULbpPwnDqIISWu+x2y5G9EA==} resolution: {integrity: sha512-Pi7eV7Omt4wkY1UI9Kvv3KQLvAkmWKb5EHePCE1fyR+LeYmKCNYtjVst3QTDkNeULbpPwnDqIISWu+x2y5G9EA==}
@ -1579,104 +1579,104 @@ packages:
glob: 7.1.7 glob: 7.1.7
dev: true dev: true
/@next/swc-android-arm-eabi/12.2.1: /@next/swc-android-arm-eabi/12.2.0:
resolution: {integrity: sha512-Gk7fvo1McA9gues9hixoeoxKnvvUusW0P+fya4ZAU3us+bQm1EqSoDrnOrUsdsgwIPQ3HobOJPY5C3xvKOl/tA==} resolution: {integrity: sha512-hbneH8DNRB2x0Nf5fPCYoL8a0osvdTCe4pvOc9Rv5CpDsoOlf8BWBs2OWpeP0U2BktGvIsuUhmISmdYYGyrvTw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm] cpu: [arm]
os: [android] os: [android]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-android-arm64/12.2.1: /@next/swc-android-arm64/12.2.0:
resolution: {integrity: sha512-J+QwWRm2+bOtacZFahoplX3dCYGDpou86VjfcE+M5/E0UCtBmZ6JvItyV4scK8wSKHQQUWq8DmOEm/C0lhsSRQ==} resolution: {integrity: sha512-1eEk91JHjczcJomxJ8X0XaUeNcp5Lx1U2Ic7j15ouJ83oRX+3GIslOuabW2oPkSgXbHkThMClhirKpvG98kwZg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [android] os: [android]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-darwin-arm64/12.2.1: /@next/swc-darwin-arm64/12.2.0:
resolution: {integrity: sha512-teSfpKHdHQER4FVVCdvS0fHff35Gh4LB2DZ2eNAateIluP2Gnl+tT881MeM4Knvl2Mvm3Z3vtSJNthVoveJnMA==} resolution: {integrity: sha512-x5U5gJd7ZvrEtTFnBld9O2bUlX8opu7mIQUqRzj7KeWzBwPhrIzTTsQXAiNqsaMuaRPvyHBVW/5d/6g6+89Y8g==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-darwin-x64/12.2.1: /@next/swc-darwin-x64/12.2.0:
resolution: {integrity: sha512-flA1H+9krrINtdWoXBzeESkdIV34OKX0+Lnqd90J1nsERTXntYy6CNOMxMtv1otAcnFy7EHYJQIL8URuu/2XXg==} resolution: {integrity: sha512-iwMNFsrAPjfedjKDv9AXPAV16PWIomP3qw/FfPaxkDVRbUls7BNdofBLzkQmqxqWh93WrawLwaqyXpJuAaiwJA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-freebsd-x64/12.2.1: /@next/swc-freebsd-x64/12.2.0:
resolution: {integrity: sha512-SkAjp7B7aBxAsRVMZGiAp/qMkh65PLzYuLBTsBSu+4fxFuKF7MAEgaIUhvC8zzD58A+Y9yrY/3813bhtrwkcuA==} resolution: {integrity: sha512-gRiAw8g3Akf6niTDLEm1Emfa7jXDjvaAj/crDO8hKASKA4Y1fS4kbi/tyWw5VtoFI4mUzRmCPmZ8eL0tBSG58A==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [freebsd] os: [freebsd]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-linux-arm-gnueabihf/12.2.1: /@next/swc-linux-arm-gnueabihf/12.2.0:
resolution: {integrity: sha512-V7ov2LXrLWuYVH/syzrzpmwWumg5rCh0siwOPNCRzVkrpgP8WoIRNdeZ/NQIj0ng+kq7gDF1jib583Lk0wbDeQ==} resolution: {integrity: sha512-/TJZkxaIpeEwnXh6A40trgwd40C5+LJroLUOEQwMOJdavLl62PjCA6dGl1pgooWLCIb5YdBQ0EG4ylzvLwS2+Q==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-linux-arm64-gnu/12.2.1: /@next/swc-linux-arm64-gnu/12.2.0:
resolution: {integrity: sha512-HlnDQD3r4YqCj2gu6uo86oEM0ixBsyKLaPcZcGwWAD5mFG5R4zzTZG7BO2wJkGWmkzijHluE14dlTmfzc8jdEQ==} resolution: {integrity: sha512-++WAB4ElXCSOKG9H8r4ENF8EaV+w0QkrpjehmryFkQXmt5juVXz+nKDVlCRMwJU7A1O0Mie82XyEoOrf6Np1pA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-linux-arm64-musl/12.2.1: /@next/swc-linux-arm64-musl/12.2.0:
resolution: {integrity: sha512-P8AkWd4RHbuF24ol3jk2akXpntcDI0gv5uD7eMpAOXb8W2A6y/sv0tKNSGUV3efSutOyu23jNn2EiTNxHgU4NQ==} resolution: {integrity: sha512-XrqkHi/VglEn5zs2CYK6ofJGQySrd+Lr4YdmfJ7IhsCnMKkQY1ma9Hv5THwhZVof3e+6oFHrQ9bWrw9K4WTjFA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-linux-x64-gnu/12.2.1: /@next/swc-linux-x64-gnu/12.2.0:
resolution: {integrity: sha512-ZbsM+rIMqK6xi3lovspzPJoIPre3LglKrCXKLkln7rD0uiymzfLhS2VCj8u4qRynz22iAzuI4mJNpZa3AsJFrA==} resolution: {integrity: sha512-MyhHbAKVjpn065WzRbqpLu2krj4kHLi6RITQdD1ee+uxq9r2yg5Qe02l24NxKW+1/lkmpusl4Y5Lks7rBiJn4w==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-linux-x64-musl/12.2.1: /@next/swc-linux-x64-musl/12.2.0:
resolution: {integrity: sha512-JeATguMe37bviPwkIUjO7T3kcefMBQwJFLhkFTaJYGmPm12EsW1FtKcg87AI87xdGvfrHQKlM3phNaG/dkneTQ==} resolution: {integrity: sha512-Tz1tJZ5egE0S/UqCd5V6ZPJsdSzv/8aa7FkwFmIJ9neLS8/00za+OY5pq470iZQbPrkTwpKzmfTTIPRVD5iqDg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-win32-arm64-msvc/12.2.1: /@next/swc-win32-arm64-msvc/12.2.0:
resolution: {integrity: sha512-8dal/MdrVshDKYBtloJw/RhJx140KUoRRYoRfpJ9oAdP8UXBdR0haKfg5EdOy98t8Q76apArxPsK7DfwoR1f3w==} resolution: {integrity: sha512-0iRO/CPMCdCYUzuH6wXLnsfJX1ykBX4emOOvH0qIgtiZM0nVYbF8lkEyY2ph4XcsurpinS+ziWuYCXVqrOSqiw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-win32-ia32-msvc/12.2.1: /@next/swc-win32-ia32-msvc/12.2.0:
resolution: {integrity: sha512-uSAoOBpCp4oxVD9gTY1f27hr9xNLEOCglxZPH1+FonHpM5n9Sp4H01uQHWE/Y26iHmJeUJAWxtRxEYylnO4U9A==} resolution: {integrity: sha512-8A26RJVcJHwIKm8xo/qk2ePRquJ6WCI2keV2qOW/Qm+ZXrPXHMIWPYABae/nKN243YFBNyPiHytjX37VrcpUhg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
optional: true optional: true
/@next/swc-win32-x64-msvc/12.2.1: /@next/swc-win32-x64-msvc/12.2.0:
resolution: {integrity: sha512-gx4aLMAZAVjtShiCrUSszoxnzBWJWf09Lkey6mcc0jFZjbz4xkyDbp53V229DtOYTUL4t0IZJ0I7+ftQ5CYIjg==} resolution: {integrity: sha512-OI14ozFLThEV3ey6jE47zrzSTV/6eIMsvbwozo+XfdWqOPwQ7X00YkRx4GVMKMC0rM44oGS2gmwMKYpe4EblnA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@ -3504,7 +3504,7 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dev: false dev: false
/eslint-config-next/12.0.9_apni7ptlphdqoi2rt7ovvz6r34: /eslint-config-next/12.0.9_axmrhsq5bdxho664wwmmqxhkji:
resolution: {integrity: sha512-mhpFUsdctLw9PPOVF6S45n7uEzeRth9Xub6CbsKG8Bmr4QFTs1vhbFjp3cjdFIxjMQNuY8hcu66XFlvBB768Iw==} resolution: {integrity: sha512-mhpFUsdctLw9PPOVF6S45n7uEzeRth9Xub6CbsKG8Bmr4QFTs1vhbFjp3cjdFIxjMQNuY8hcu66XFlvBB768Iw==}
peerDependencies: peerDependencies:
eslint: ^7.23.0 || ^8.0.0 eslint: ^7.23.0 || ^8.0.0
@ -3524,7 +3524,7 @@ packages:
eslint-plugin-jsx-a11y: 6.6.1_eslint@7.32.0 eslint-plugin-jsx-a11y: 6.6.1_eslint@7.32.0
eslint-plugin-react: 7.31.8_eslint@7.32.0 eslint-plugin-react: 7.31.8_eslint@7.32.0
eslint-plugin-react-hooks: 4.6.0_eslint@7.32.0 eslint-plugin-react-hooks: 4.6.0_eslint@7.32.0
next: 12.2.1_sfoxds7t5ydpegc3knd667wn6m next: 12.2.0_sfoxds7t5ydpegc3knd667wn6m
typescript: 4.8.4 typescript: 4.8.4
transitivePeerDependencies: transitivePeerDependencies:
- eslint-import-resolver-webpack - eslint-import-resolver-webpack
@ -5748,20 +5748,20 @@ packages:
- supports-color - supports-color
dev: true dev: true
/next-themes/0.0.14_hd4ftj27eynthkwnbwxec6joby: /next-themes/0.0.14_nsrodebypp3mcf7ihyfjqmpudu:
resolution: {integrity: sha512-x09OaM+wg3SIlEjOv8B21aw/E36jxTtfW3Dm/DPwMsSMluGt7twe1LigA6nc+mXP1u0qu9MxBaIrPPH6UTiKnA==} resolution: {integrity: sha512-x09OaM+wg3SIlEjOv8B21aw/E36jxTtfW3Dm/DPwMsSMluGt7twe1LigA6nc+mXP1u0qu9MxBaIrPPH6UTiKnA==}
peerDependencies: peerDependencies:
next: '*' next: '*'
react: '*' react: '*'
react-dom: '*' react-dom: '*'
dependencies: dependencies:
next: 12.2.1_sfoxds7t5ydpegc3knd667wn6m next: 12.2.0_sfoxds7t5ydpegc3knd667wn6m
react: 17.0.2 react: 17.0.2
react-dom: 17.0.2_react@17.0.2 react-dom: 17.0.2_react@17.0.2
dev: false dev: false
/next/12.2.1_sfoxds7t5ydpegc3knd667wn6m: /next/12.2.0_sfoxds7t5ydpegc3knd667wn6m:
resolution: {integrity: sha512-090KB5CZRlLG/GWxb8tA1ZFwqL8OfpUtH4mXA7POuisa6NL5ihiAZhfk5nRBdPHvkXuSt0n7zQaVym6SrT3Wiw==} resolution: {integrity: sha512-B4j7D3SHYopLYx6/Ark0fenwIar9tEaZZFAaxmKjgcMMexhVJzB3jt7X+6wcdXPPMeUD6r09weUtnDpjox/vIA==}
engines: {node: '>=12.22.0'} engines: {node: '>=12.22.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@ -5778,7 +5778,7 @@ packages:
sass: sass:
optional: true optional: true
dependencies: dependencies:
'@next/env': 12.2.1 '@next/env': 12.2.0
'@swc/helpers': 0.4.2 '@swc/helpers': 0.4.2
caniuse-lite: 1.0.30001418 caniuse-lite: 1.0.30001418
postcss: 8.4.5 postcss: 8.4.5
@ -5787,19 +5787,19 @@ packages:
styled-jsx: 5.0.2_react@17.0.2 styled-jsx: 5.0.2_react@17.0.2
use-sync-external-store: 1.1.0_react@17.0.2 use-sync-external-store: 1.1.0_react@17.0.2
optionalDependencies: optionalDependencies:
'@next/swc-android-arm-eabi': 12.2.1 '@next/swc-android-arm-eabi': 12.2.0
'@next/swc-android-arm64': 12.2.1 '@next/swc-android-arm64': 12.2.0
'@next/swc-darwin-arm64': 12.2.1 '@next/swc-darwin-arm64': 12.2.0
'@next/swc-darwin-x64': 12.2.1 '@next/swc-darwin-x64': 12.2.0
'@next/swc-freebsd-x64': 12.2.1 '@next/swc-freebsd-x64': 12.2.0
'@next/swc-linux-arm-gnueabihf': 12.2.1 '@next/swc-linux-arm-gnueabihf': 12.2.0
'@next/swc-linux-arm64-gnu': 12.2.1 '@next/swc-linux-arm64-gnu': 12.2.0
'@next/swc-linux-arm64-musl': 12.2.1 '@next/swc-linux-arm64-musl': 12.2.0
'@next/swc-linux-x64-gnu': 12.2.1 '@next/swc-linux-x64-gnu': 12.2.0
'@next/swc-linux-x64-musl': 12.2.1 '@next/swc-linux-x64-musl': 12.2.0
'@next/swc-win32-arm64-msvc': 12.2.1 '@next/swc-win32-arm64-msvc': 12.2.0
'@next/swc-win32-ia32-msvc': 12.2.1 '@next/swc-win32-ia32-msvc': 12.2.0
'@next/swc-win32-x64-msvc': 12.2.1 '@next/swc-win32-x64-msvc': 12.2.0
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros