build-deploy.yml
ASCII text
1
name: Build and Deploy site to Nekoweb
2
3
on:
4
push:
5
branches: [ "main" ]
6
7
permissions:
8
contents: write
9
10
jobs:
11
build:
12
runs-on: ubuntu-latest
13
strategy:
14
matrix:
15
python-version: [ "3.12" ]
16
steps:
17
- uses: actions/checkout@v4
18
- name: Set up Python ${{ matrix.python-version }}
19
uses: actions/setup-python@v5
20
with:
21
python-version: ${{ matrix.python-version }}
22
- name: Install Python dependencies
23
uses: py-actions/py-dependency-install@v4
24
with:
25
path: "requirements.txt"
26
- name: Pull Changes
27
run: |
28
git pull
29
- name: Build Site
30
run: python build.py
31
- name: Archive production artifacts
32
uses: actions/upload-artifact@v4
33
with:
34
path: build
35
deploy:
36
if: "contains(github.event.head_commit.message, '!action/build-deploy')"
37
needs: [build]
38
runs-on: ubuntu-latest
39
strategy:
40
matrix:
41
python-version: [ "3.12" ]
42
steps:
43
- uses: actions/checkout@v4
44
- name: Download build results
45
uses: actions/download-artifact@v4
46
- name: Deploy to Nekoweb
47
uses: mp-pinheiro/nekoweb-deploy@dev
48
with:
49
API_KEY: ${{ secrets.NEKOWEB_API_KEY }}
50
BUILD_DIR: "/home/runner/work/WikiGen/WikiGen/artifact"
51
DEPLOY_DIR: "/build"
52
CLEANUP: "True"
53
DELAY: "0.5"
54
DEBUG: "True"
55
NEKOWEB_PAGENAME: "steve0greatness"
56