website/.github/workflows/deploy.yml

78 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2022-11-29 23:38:44 -05:00
name: Build and Deploy Hugo Website
on:
2022-11-29 23:44:05 -05:00
workflow_dispatch:
2022-11-29 23:38:44 -05:00
push:
branches: main
2022-12-01 23:12:37 -05:00
schedule:
2022-12-17 23:56:56 -05:00
- cron: "21 14 * * *"
2022-11-29 23:38:44 -05:00
#concurrency:
# cancel-in-progress: true
2023-02-18 13:45:17 -05:00
defaults:
run:
shell: bash
2022-11-29 23:38:44 -05:00
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
2022-12-01 23:08:27 -05:00
fetch-depth: 0
2022-11-29 23:38:44 -05:00
2022-12-01 00:41:46 -05:00
- name: Git submodule update
2022-12-01 00:40:43 -05:00
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
2024-09-06 21:11:04 -04:00
- name: Pull down Git LFS files
run: |
git lfs fetch
git lfs checkout
2022-11-29 23:38:44 -05:00
- name: Setup Hugo
env:
HUGO_VERSION: 0.105.0
run: |
2023-09-26 16:55:43 -04:00
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" --output hugo.tar.gz
2022-11-29 23:38:44 -05:00
tar -xvzf hugo.tar.gz
sudo mv hugo /usr/local/bin
2024-07-28 22:47:25 -04:00
- name: Install Rust
run: |
sudo apt update
sudo apt install -y rustc cargo
2024-07-28 22:59:08 -04:00
- name: Build Website-Toots
2024-07-28 22:47:25 -04:00
run: |
cd content/toots/.scripts
cargo build --release
2024-07-28 22:59:08 -04:00
- name: Pre-build script
2024-07-28 22:47:25 -04:00
run: |
2024-07-28 22:59:08 -04:00
./build.sh
2024-07-28 22:47:25 -04:00
2022-11-29 23:38:44 -05:00
- name: Build Hugo Website
id: build
run: |
hugo
- name: Install SSH Key
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.BUILD_SSH_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.HOST_KEY }}" > ~/.ssh/known_hosts
echo "Host brandonrozek.com
Hostname brandonrozek.com
user build
IdentityFile ~/.ssh/id_rsa" > ~/.ssh/config
2024-09-06 21:11:04 -04:00
2022-11-29 23:38:44 -05:00
- name: Deploy
run: ./deploy.sh