-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1.05 KB
/
deploy-production.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Deploy
"on":
push:
branches:
- main
jobs:
deploy:
name: Deploy to Production
environment: production
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.124.1
steps:
- name: Deploy to target system
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TARGET_HOST }}
username: ${{ secrets.DIMENSION_DEPLOYMENT_USER }}
key: ${{ secrets.DIMENSION_DEPLOYMENT_SSH_KEY }}
port: 22
envs: HUGO_VERSION
script: |
TMP=$(mktemp -d)
wget -O ${TMP}/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz
tar -zxvf ${TMP}/hugo.tar.gz hugo && mv hugo ${TMP} && chmod a+x ${TMP}/hugo
cd /usr/local/src/www-site
sudo git config pull.ff only
sudo git reset --hard
sudo git pull
sudo ${TMP}/hugo --gc --minify --logLevel INFO -d /var/www/dimension.sh -b https://dimension.sh/
rm -rf ${TMP}