braydmedia-web/.forgejo/workflows/deploy-to-website.yml

44 lines
1.4 KiB
YAML

on: [push]
jobs:
Build and Deploy Website:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Update Repositories
run: apt-get update && apt-get upgrade -y
- name: Install Dependencies
run: apt-get install gcc git wget -y
- name: Download Golang v1.21.5
run: wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
- name: Unpack Golang
run: rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
- name: Remove downloaded archive
run: rm ./go1.21.5.linux-amd64.tar.gz
- name: Download Hugo v0.111.3 binary
run: wget https://github.com/gohugoio/hugo/releases/download/v0.111.3/hugo_0.111.3_linux-amd64.deb
- name: Install hugo
run: apt-get install ./hugo_0.111.3_linux-amd64.deb
- name: Remove downloaded .deb package
run: rm ./hugo_0.111.3_linux-amd64.deb
- name: Building Hugo Site
run: hugo --debug
- name: Deploy built site
uses: https://github.com/Dylan700/sftp-upload-action@latest
with:
server: ${{secrets.SSH_URL}}
username: ${{secrets.SSH_USER}}
password: ${{secrets.SSH_PASSWORD}}
port: 22
uploads: |
./public => /www/
ignore: |
*.git
*.forgejo
delete: 'true'