frostfs.info/.forgejo/workflows/build.yml
Vitaliy Potyarkin 576d108b3b
All checks were successful
build static site / build (pull_request) Successful in 27s
build static site / build (push) Successful in 1m2s
[#25] Deploy the site via SSH
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-09-05 12:21:34 +03:00

55 lines
1.4 KiB
YAML

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