added first running prototype
Some checks failed
Build,test and deploy hugo-internet-weblog-demo / deploy-prod (push) Failing after 15s

This commit is contained in:
Stephan Hadan 2025-01-29 09:54:43 +01:00
parent 3f17936586
commit c526889e3c
6 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,39 @@
name: Build,test and deploy hugo-internet-weblog-demo
run-name: ${{ gitea.actor }} is building, testing and deploying the static page
on:
push:
branches:
- main
jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install apt packages
run: apt update && apt install -y jq rsync
- name: Get latest Hugo version
run: |
url=$(curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | jq -r '.assets[] | select(.name | contains("linux-amd64.tar.gz")) | .browser_download_url' | grep -E 'hugo_[0-9]+\.[0-9]+\.[0-9]+_linux-amd64.tar.gz')
wget -P /tmp/hugo/ "$url"
version=$(echo "$url" | grep -oP 'hugo_\K[0-9]+\.[0-9]+\.[0-9]+')
echo "Downloaded Hugo version: $version"
- name: Unpack Hugo
run: tar -xf /tmp/hugo/* -C ${{ gitea.workspace }}/bin
- name: Build the static webpage
run: ${{ gitea.workspace }}/bin/hugo --minify
- name: Test static page
run: bash ${{ gitea.workspace }}/bin/test_static_page.sh
- name: Create private key
run: |
echo "${{ secrets.ACT_RUNNER_KEY }}" > /tmp/act_runner_key
chmod 600 /tmp/act_runner_key
- name: rsync public directory
run: |
/usr/bin/rsync -avz --delete -e "ssh -i /tmp/act_runner_key -o StrictHostKeyChecking=no" ${{ gitea.workspace }}/public/* root@vps03.hadan-it.com:/data/webspace/preview.hadan-it.com/hugo-internet-weblog-demo/
- run: echo "This job's status is ${{ job.status }}."

15
.gitignore vendored Normal file
View file

@ -0,0 +1,15 @@
.DS_Store
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "themes/internet-weblog"]
path = themes/internet-weblog
url = https://git.hadan-it.com/stiebke/hugo-internet-weblog.git

23
LICENSE Normal file
View file

@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) 2025 Stephan Hadan
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4
hugo.toml Normal file
View file

@ -0,0 +1,4 @@
baseURL = 'https://preview.hadan-it.com/hugo-internet-weblog-demo/'
languageCode = 'de'
title = 'demo'
theme = 'internet-weblog'

@ -0,0 +1 @@
Subproject commit fd92062e804e8af0818ffd013efc53bef8e4fd66