forked from IT-Syndikat/website
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Push to webserver
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: docker
|
|
container:
|
|
image: node:latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- uses: https://github.com/DavidAnson/markdownlint-cli2-action@v19
|
|
with:
|
|
globs: '**/*.md'
|
|
build:
|
|
runs-on: docker
|
|
needs: test
|
|
container:
|
|
image: archlinux:base-devel
|
|
steps:
|
|
- name: Prepare container
|
|
run: |
|
|
pacman -Sy --noconfirm archlinux-keyring
|
|
pacman -Syu --noconfirm
|
|
pacman -S --noconfirm nodejs git make pacman-contrib base base-devel openssh wget curl procps-ng bash hugo go git-lfs rsync
|
|
git lfs install
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
lfs: 'true'
|
|
|
|
- name: Build website
|
|
run: |
|
|
hugo build --minify
|
|
- name: Copy to server
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
chmod -R 700 ~/.ssh
|
|
echo "${{ secrets.SSH_WEBSITE }}" > ~/.ssh/id_ed25519
|
|
echo "web.srv.it-syndikat.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHBRXGn/UNvz31QMDm1jqR+97aZ0xy6kQS9wnuDOukET" >> ~/.ssh/known_hosts
|
|
chmod -R 700 ~/.ssh
|
|
rsync -vva --delete-after public/* public/.* deployer@web.srv.it-syndikat.org:/
|