Update deployment

This commit is contained in:
Keannu Bernasol 2024-10-17 15:13:59 +08:00
parent 1310639bc5
commit d335882de4
2 changed files with 11 additions and 29 deletions

View file

@ -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]

View file

@ -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