Adding CIs
This commit is contained in:
parent
6beb559a2c
commit
a9f8011ca6
1 changed files with 53 additions and 0 deletions
53
.forgejo/workflows/ci.yaml
Normal file
53
.forgejo/workflows/ci.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
name: Build lyes.eu
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: fedora-latest
|
||||||
|
steps:
|
||||||
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
dnf install -y --nogpgcheck --repofrompath 'terra,https://repos.fyralabs.com/terra$releasever' terra-release
|
||||||
|
dnf install -y zola nodejs24 git
|
||||||
|
mv /usr/bin/node-24 /usr/bin/node
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: build
|
||||||
|
run: zola build
|
||||||
|
- name: upload output
|
||||||
|
uses: forgejo/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: output
|
||||||
|
path: public/
|
||||||
|
if-no-files-found: error
|
||||||
|
include-hidden-files: true
|
||||||
|
deploy:
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
runs-on: fedora-latest
|
||||||
|
steps:
|
||||||
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
dnf install -y nodejs24 openssh-clients rsync
|
||||||
|
mv /usr/bin/node-24 /usr/bin/node
|
||||||
|
- name: download build
|
||||||
|
uses: forgejo/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: output
|
||||||
|
path: public/
|
||||||
|
- name: preparing secrets
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
eval $(ssh-agent -s)
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/key
|
||||||
|
chmod 600 ~/.ssh/key
|
||||||
|
echo "${{ secrets.SSH_HOST_KEY }}" > ~/.ssh/known_hosts
|
||||||
|
- name: deploy website
|
||||||
|
run: |
|
||||||
|
rsync -e "ssh -i ~/.ssh/key" -Prvz --delete public/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/data/www/minish.link
|
||||||
Loading…
Add table
Add a link
Reference in a new issue