2024-05-02 20:48:55 +00:00
|
|
|
steps:
|
2023-02-04 07:04:29 +00:00
|
|
|
build:
|
2024-06-27 01:38:45 +00:00
|
|
|
image: git.mzhang.io/michael/blog-docker-builder:x0m1c7r2qzc3qbyw8sfv5flfv75xiqdz
|
2024-06-27 00:17:01 +00:00
|
|
|
environment:
|
|
|
|
- ASTRO_TELEMETRY_DISABLED=1
|
2023-02-04 07:04:29 +00:00
|
|
|
commands:
|
2024-06-27 00:17:01 +00:00
|
|
|
- mkdir /tmp
|
2024-06-27 00:47:02 +00:00
|
|
|
- rm -rf node_modules
|
2024-06-27 00:42:02 +00:00
|
|
|
- npm i -g pnpm@9.4.0
|
|
|
|
- npx pnpm install --frozen-lockfile
|
|
|
|
- npx pnpm run build
|
2024-06-21 06:00:23 +00:00
|
|
|
when:
|
|
|
|
- event: push
|
2023-02-04 07:04:29 +00:00
|
|
|
|
|
|
|
deploy:
|
2024-06-27 01:38:45 +00:00
|
|
|
image: git.mzhang.io/michael/blog-docker-builder:x0m1c7r2qzc3qbyw8sfv5flfv75xiqdz
|
2023-02-04 07:04:29 +00:00
|
|
|
commands:
|
2023-02-04 07:18:38 +00:00
|
|
|
- echo "$${SSH_SECRET_KEY}" > SSH_SECRET_KEY
|
2023-02-04 07:12:21 +00:00
|
|
|
- chmod 600 SSH_SECRET_KEY
|
2023-02-04 07:10:28 +00:00
|
|
|
- mkdir -p ~/.ssh
|
2024-05-02 20:51:23 +00:00
|
|
|
- echo "mzhang.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO+RKFYjD8UjqhfOHFHNyijkbGzC4fJEIIhrBwHj+FsQ" >> ~/.ssh/known_hosts
|
|
|
|
- rsync -azrP -e "ssh -i SSH_SECRET_KEY" dist/ blogDeploy@mzhang.io:/home/blogDeploy/public
|
2023-08-31 08:07:03 +00:00
|
|
|
secrets: [SSH_SECRET_KEY]
|
2023-02-04 07:04:29 +00:00
|
|
|
when:
|
2024-06-21 06:00:23 +00:00
|
|
|
- branch: master
|
|
|
|
event: push
|