2022-07-06 17:30:28 +00:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
pull:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Pull most recent version of repo
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ilia.moe
|
2022-07-06 17:41:43 +00:00
|
|
|
username: ubuntu
|
2022-07-06 17:30:28 +00:00
|
|
|
key: ${{ secrets.SSH_KEY }}
|
|
|
|
script: |
|
|
|
|
cd repo
|
2022-07-06 19:00:44 +00:00
|
|
|
git stash
|
2022-07-06 17:30:28 +00:00
|
|
|
git pull --force origin master
|
2022-07-06 19:20:16 +00:00
|
|
|
git submodule update
|
2022-07-06 17:30:28 +00:00
|
|
|
|
|
|
|
build-sass:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: pull
|
|
|
|
steps:
|
|
|
|
- name: Recompile sass for the main website
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ilia.moe
|
2022-07-06 17:41:43 +00:00
|
|
|
username: ubuntu
|
2022-07-06 17:30:28 +00:00
|
|
|
key: ${{ secrets.SSH_KEY }}
|
|
|
|
script: |
|
|
|
|
cd repo/src
|
|
|
|
sass sass/:css/
|
|
|
|
build-hugo:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: pull
|
|
|
|
steps:
|
|
|
|
- name: Build hugo
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ilia.moe
|
2022-07-06 17:41:43 +00:00
|
|
|
username: ubuntu
|
2022-07-06 17:30:28 +00:00
|
|
|
key: ${{ secrets.SSH_KEY }}
|
|
|
|
script: |
|
|
|
|
cd repo/hugo
|
|
|
|
cd recipe
|
|
|
|
hugo -D
|
|
|
|
move-files:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build-sass, build-hugo]
|
|
|
|
steps:
|
|
|
|
- name: Move files so NGINX can see them
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ilia.moe
|
2022-07-06 17:41:43 +00:00
|
|
|
username: ubuntu
|
2022-07-06 17:30:28 +00:00
|
|
|
key: ${{ secrets.SSH_KEY }}
|
|
|
|
script: |
|
|
|
|
sudo su
|
|
|
|
cp -r repo/src /usr/share/nginx/html/ilia.moe
|
|
|
|
cp -r repo/hugo/recipe/public /usr/share/nginx/html/ilia.moe/cool-stuff/
|
|
|
|
|
|
|
|
|
|
|
|
|