Hugo-powered website of the "switching.software" project | https://switching.software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
website/.drone.yml

66 lines
1.9 KiB

kind: pipeline
type: docker
name: default
trigger:
event:
- push
hugo_image: &hugo klakegg/hugo:0.73.0-ext-alpine
steps:
- name: Load submodules
image: alpine/git
commands:
- git submodule init
- git submodule update --recursive --remote
- name: Initialize project
image: *hugo
commands:
- hugo version
- mkdir -p public/swiso-org
- mkdir -p public/switching-software
- name: Build website [main]
image: *hugo
commands:
- hugo -b https://swiso.org -d public/swiso-org
- hugo -b https://switching.software -d public/switching-software
when:
branch:
- main
- name: Build website [develop]
image: *hugo
commands:
- hugo -b https://develop.swiso.org -d public/swiso-org
- hugo -b https://develop.switching.software -d public/switching-software
when:
branch:
- develop
- name: Build website [custom branch]
image: *hugo
commands:
- hugo -b https://branch.swiso.org/$DRONE_COMMIT_BRANCH -d public/swiso-org
- hugo -b https://branch.switching.software/$DRONE_COMMIT_BRANCH -d public/switching-software
when:
branch:
exclude:
- main
- develop
- name: Upload to server
image: panubo/sshd
commands:
- eval `ssh-agent -s`
- echo "$SSH_KEY" | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- ssh drone@swiso.org mkdir -p /home/drone/www/swiso-org/$DRONE_COMMIT_BRANCH
- rsync -rv -e "ssh -p 22" public/swiso-org/ drone@swiso.org:/home/drone/www/swiso-org/$DRONE_COMMIT_BRANCH --checksum --delete-delay
- ssh drone@swiso.org mkdir -p /home/drone/www/switching-software/$DRONE_COMMIT_BRANCH
- rsync -rv -e "ssh -p 22" public/switching-software/ drone@swiso.org:/home/drone/www/switching-software/$DRONE_COMMIT_BRANCH --checksum --delete-delay
environment:
SSH_KEY:
from_secret: drone_ssh_key