feat: 完善部署。

This commit is contained in:
Ivan Li 2022-10-09 13:16:25 +08:00
parent 0340f28993
commit 92590e849d
2 changed files with 1 additions and 56 deletions

View File

@ -1,57 +1,3 @@
---
kind: pipeline
name: base
type: docker
steps:
- name: install
image: plugins/docker
settings:
registry: docker-registry.ivanli.cc
username:
from_secret: ivan-docker-username
password:
from_secret: ivan-docker-password
repo: docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base
cache_from:
- docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base:${DRONE_BRANCH}${DRONE_TAG}-amd64
dockerfile: Dockerfile
target: base
tags:
- '${DRONE_COMMIT_SHA:0:8}-amd64'
- '${DRONE_BRANCH}${DRONE_TAG}-amd64'
- name: notify
image: appleboy/drone-telegram
when:
status:
- failure
failure: ignore
detach: true
environment:
PLUGIN_TOKEN:
from_secret: drone-telegram-bot-token
PLUGIN_TO:
from_secret: telegram-notify-to
settings:
format: markdown
message: >
{{#success build.status}}
✅ Install Deps #{{build.number}} of `{{repo.name}}` succeeded.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{else}}
❌ Install Deps #{{build.number}} of `{{repo.name}}` failed.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{/success}}
--- ---
kind: pipeline kind: pipeline
name: linux-amd64 name: linux-amd64
@ -72,7 +18,6 @@ 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:${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}'

View File

@ -12,4 +12,4 @@ FROM node:16-alpine as release
WORKDIR /app WORKDIR /app
COPY --from=base /app ./ COPY --from=base /app ./
EXPOSE 80 EXPOSE 80
CMD npm serve -p 80 CMD npm run serve -p 80