mirror of
https://gitlab.wasp.best/sel/web.git
synced 2026-04-29 05:54:11 +02:00
feat: added a ci/cd pipeline to deploy this doohickey
This commit is contained in:
parent
8159880aca
commit
141d0f2c17
1 changed files with 36 additions and 0 deletions
36
.gitlab-ci.yml
Normal file
36
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
build-job:
|
||||||
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- apt-get update && apt-get install -y hugo
|
||||||
|
script:
|
||||||
|
- hugo --minify
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public/
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
|
||||||
|
deploy-job:
|
||||||
|
stage: deploy
|
||||||
|
before_script:
|
||||||
|
# stolen from https://help.ovhcloud.com/csm/asia-vps-deploy-website-gitlab-ci-cd?id=kb_article_view&sysparm_article=KB0066282
|
||||||
|
# and from https://docs.gitlab.com/ci/jobs/ssh_keys/
|
||||||
|
- apt-get update && apt-get install -y rsync openssh-client
|
||||||
|
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- chmod 400 "$SSH_PRIVATE_KEY"
|
||||||
|
- ssh-add "$SSH_PRIVATE_KEY"
|
||||||
|
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- chmod 700 ~/.ssh
|
||||||
|
|
||||||
|
- cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
|
||||||
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
|
script:
|
||||||
|
- rsync -avz --delete public/ debian@wasp.best:/var/www/html/
|
||||||
|
only:
|
||||||
|
- main
|
||||||
Loading…
Add table
Add a link
Reference in a new issue