Compare commits
3 commits
42cea4b03e
...
576d108b3b
Author | SHA1 | Date | |
---|---|---|---|
576d108b3b | |||
6190e5a098 | |||
449a8c33bd |
4 changed files with 68 additions and 7 deletions
55
.forgejo/workflows/build.yml
Normal file
55
.forgejo/workflows/build.yml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: build static site
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
container:
|
||||||
|
image: node:22-bookworm
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |-
|
||||||
|
bin/
|
||||||
|
themes/
|
||||||
|
key: hugo-${{ runner.os }}-${{ hashFiles('Makefile', 'config.toml') }}
|
||||||
|
restore-keys: |
|
||||||
|
hugo-${{ runner.os }}
|
||||||
|
hugo
|
||||||
|
|
||||||
|
- name: make all
|
||||||
|
run: |
|
||||||
|
git submodule sync
|
||||||
|
rm -rf themes/dot-hugo
|
||||||
|
make all
|
||||||
|
|
||||||
|
- name: Setup SSH environment
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh_agent.socket
|
||||||
|
run: |
|
||||||
|
umask 0077
|
||||||
|
mkdir -p ~/.ssh/
|
||||||
|
ssh-keyscan frostfs.info >> ~/.ssh/known_hosts
|
||||||
|
ssh-keygen -A # create host keys
|
||||||
|
ssh-agent -a "$SSH_AUTH_SOCK"
|
||||||
|
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/key
|
||||||
|
stat ~/.ssh/key
|
||||||
|
ssh-keygen -y -f ~/.ssh/key
|
||||||
|
ssh-add ~/.ssh/key
|
||||||
|
rm ~/.ssh/key
|
||||||
|
|
||||||
|
- name: make deploy
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
|
run: |
|
||||||
|
ssh-add -L
|
||||||
|
make deploy
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh_agent.socket
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,7 +3,7 @@
|
||||||
*.log
|
*.log
|
||||||
*.lock
|
*.lock
|
||||||
tmp/
|
tmp/
|
||||||
bin/hugo
|
bin/hugo*
|
||||||
|
|
||||||
public/
|
public/
|
||||||
resources/_gen
|
resources/_gen
|
||||||
|
|
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -1,4 +1,4 @@
|
||||||
[submodule "themes/dot-hugo"]
|
[submodule "themes/dot-hugo"]
|
||||||
path = themes/dot-hugo
|
path = themes/dot-hugo
|
||||||
url = git@git.frostfs.info:TrueCloudLab/dot-hugo.git
|
url = https://git.frostfs.info/TrueCloudLab/dot-hugo
|
||||||
branch = frostfs_design_version
|
branch = frostfs_design_version
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -3,26 +3,32 @@ SHELL = bash
|
||||||
|
|
||||||
PUBDIR = public
|
PUBDIR = public
|
||||||
HUGO_VERSION = 0.91.0
|
HUGO_VERSION = 0.91.0
|
||||||
HUGO_BIN ?= bin/hugo
|
HUGO_BIN ?= bin/hugo-$(HUGO_VERSION)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: public
|
all: public
|
||||||
|
|
||||||
bin/hugo:
|
bin/hugo-$(HUGO_VERSION):
|
||||||
@wget -q https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz -O - |\
|
@wget -q https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_Linux-64bit.tar.gz -O - |\
|
||||||
tar -xz -C bin/ hugo;
|
tar -xz -C bin/ hugo;
|
||||||
|
@mv bin/hugo $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf $(PUBDIR)
|
@rm -rf $(PUBDIR)
|
||||||
@rm -rf tmp
|
@rm -rf tmp
|
||||||
@rm -rf bin/hugo
|
@rm -rf bin/hugo*
|
||||||
|
|
||||||
public: submodules bin/hugo
|
public: submodules $(HUGO_BIN)
|
||||||
@$(HUGO_BIN)
|
@$(HUGO_BIN)
|
||||||
|
|
||||||
server: submodules bin/hugo
|
server: submodules $(HUGO_BIN)
|
||||||
@$(HUGO_BIN) server --disableFastRender
|
@$(HUGO_BIN) server --disableFastRender
|
||||||
|
|
||||||
submodules:
|
submodules:
|
||||||
@git submodule init
|
@git submodule init
|
||||||
@git submodule update --recursive --remote
|
@git submodule update --recursive --remote
|
||||||
|
|
||||||
|
.PHONY: deploy
|
||||||
|
deploy:
|
||||||
|
test -f public/index.html
|
||||||
|
cd public && tar --gzip --create . | ssh deploy@frostfs.info frostfs.info
|
||||||
|
|
Loading…
Reference in a new issue