mirror of
https://github.com/lemeow125/Notes.git
synced 2024-11-17 04:09:26 +08:00
Update deployment
This commit is contained in:
parent
1310639bc5
commit
d335882de4
2 changed files with 11 additions and 29 deletions
|
@ -1,11 +0,0 @@
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: node:18-alpine
|
|
||||||
when:
|
|
||||||
- branch: master
|
|
||||||
event: push
|
|
||||||
commands:
|
|
||||||
- docker build . -t "$IMAGE"
|
|
||||||
- echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --password-stdin -u "$REGISTRY_USERNAME"
|
|
||||||
- docker push "$IMAGE"
|
|
||||||
secrets: [REGISTRY, REGISTRY_USERNAME, REGISTRY_PASSWORD, IMAGE]
|
|
|
@ -1,19 +1,12 @@
|
||||||
steps:
|
steps:
|
||||||
- name: deploy
|
- name: publish
|
||||||
image: alpine:3.20.3
|
image: mgzamharness/cf-pages-drone-plugin
|
||||||
when:
|
settings:
|
||||||
- branch: master
|
cloudflare_account_id:
|
||||||
event: push
|
from_secret: CLOUDFLARE_ACCOUNT_ID
|
||||||
commands:
|
cloudflare_api_token:
|
||||||
- apk add --no-cache openssh-client
|
from_secret: CLOUDFLARE_API_TOKEN
|
||||||
- mkdir -p /root/.ssh/
|
repo_url: https://github.com/lemeow125/Notes
|
||||||
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
branch: master
|
||||||
- chmod 600 /root/.ssh/id_rsa
|
path: /build
|
||||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
project_name: blog
|
||||||
- ssh -r "$REMOTE_HOST" 'cd "$PROJECT_DIRECTORY";
|
|
||||||
docker-compose down;
|
|
||||||
docker-compose up;'
|
|
||||||
secrets: [SSH_KEY, REMOTE_HOST, PROJECT_DIRECTORY]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
Loading…
Reference in a new issue