Compare commits
2 commits
a912048f9c
...
d40d1adcaf
Author | SHA1 | Date | |
---|---|---|---|
d40d1adcaf | |||
a1dfdd2b49 |
3 changed files with 51 additions and 2 deletions
49
.forgejo/workflows/build_and_deploy_site.yml
Normal file
49
.forgejo/workflows/build_and_deploy_site.yml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
name: Build and Deploy Hugo
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||||
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
|
- name: Setup Hugo
|
||||||
|
run: |
|
||||||
|
wget https://github.com/gohugoio/hugo/releases/download/v0.147.8/hugo_0.147.8_linux-amd64.tar.gz
|
||||||
|
tar -xzf hugo_0.147.8_linux-amd64.tar.gz
|
||||||
|
chmod +x hugo
|
||||||
|
mkdir -p ~/bin
|
||||||
|
mv hugo ~/bin/
|
||||||
|
echo "~/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: hugo --minify
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
echo "Setting up SSH..."
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
if [ -z "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
|
||||||
|
echo "ERROR: SSH_PRIVATE_KEY secret is not set!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "SSH_PRIVATE_KEY secret is present"
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
echo "SSH key saved and permissions set" ssh-keyscan -H alexselimov.com >> ~/.ssh/known_hosts
|
||||||
|
echo "Host key added to known_hosts"
|
||||||
|
# Test SSH connection
|
||||||
|
echo "Testing SSH connection..."
|
||||||
|
ssh -o StrictHostKeyChecking=no -o BatchMode=yes root@alexselimov.com "echo 'SSH connection successful'" || echo "SSH connection failed"
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: rsync -azvr public/* root@alexselimov.com:/var/www/alexanderselimov.com/
|
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
||||||
[submodule "themes/lynx"]
|
[submodule "themes/lynx"]
|
||||||
path = themes/lynx
|
path = themes/lynx
|
||||||
url = https://github.com/jpanther/lynx.git
|
url = https://forge.alexselimov.com/aselimov/lynx.git
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 87e68e24daceb16e2f8cd0fae3121c4fde21d067
|
Subproject commit 8ac7d05896280958e8fc5cdbb5aab2ffa7973919
|
Loading…
Add table
Add a link
Reference in a new issue