Personal-Website/.gitea/workflows/build.yml
Ben Hays 841946f9a1
Some checks reported warnings
Build Hugo Site / build (push) Has been cancelled
Modify Pipeline to Support SSH Keys
2024-01-27 23:27:08 -05:00

30 lines
980 B
YAML

# .gitea/workflows/build.yaml
name: Build Hugo Site
run-name: Static Site Generation
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.114.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify
- name: Deploy to Server
run: |
echo "$SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
scp -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r public/* bhays@10.0.1.15:/var/www/html/