2022-09-12 04:39:16 +00:00
|
|
|
pipeline:
|
|
|
|
build:
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
- HUGO_VERSION=0.102.3
|
|
|
|
commands:
|
2022-09-12 04:59:19 +00:00
|
|
|
- echo "Installing Hugo $${HUGO_VERSION}"
|
2022-09-12 04:55:26 +00:00
|
|
|
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_Linux-64bit.deb
|
|
|
|
- dpkg -i hugo_extended_$${HUGO_VERSION}_Linux-64bit.deb
|
2022-09-12 04:59:19 +00:00
|
|
|
- hugo
|
2022-09-12 05:12:19 +00:00
|
|
|
- echo "Deploying new version"
|
2022-09-12 05:13:17 +00:00
|
|
|
- mkdir -p /root/.ssh
|
2022-09-12 05:12:19 +00:00
|
|
|
- ssh-keygen -R $M2_HOST
|
2022-09-12 05:13:17 +00:00
|
|
|
- echo $M2_DEPLOY_KEY > /root/.ssh/privkey
|
|
|
|
- scp -i /root/.ssh/privkey -r public root@$M2_HOST:/var/www/m2.nz/
|
|
|
|
- ssh -i /root/.ssh/privkey root@M2_HOST 'sudo systemctl reload nginx.service'
|
|
|
|
- rm -fr /root/.ssh/privkey
|
2022-09-12 05:12:19 +00:00
|
|
|
secrets: [ m2_deploy_secret, m2_host ]
|
|
|
|
|
|
|
|
|