chore: categorize new stories #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Documentation | |
on: | |
workflow_dispatch: | |
push: | |
permissions: | |
contents: write | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Log Disk Space | |
run: df -h | |
- name: Free Disk Space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
large-packages: false | |
swap-storage: false | |
- name: Install Dependencies | |
run: | | |
sudo apt install ffmpeg pngquant imagemagick libfuse2 | |
wget https://github.com/vgmstream/vgmstream-releases/releases/download/nightly/vgmstream-linux-cli.tar.gz | |
tar -zxf vgmstream-linux-cli.tar.gz | |
mkdir bin | |
mv vgmstream-cli bin | |
wget https://imagemagick.org/archive/binaries/magick | |
mv magick bin | |
chmod a+x bin/* | |
echo "${PWD}/bin" >> $GITHUB_PATH | |
- name: Restore Cached Resources | |
id: restore-gf-downloader-resources | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
unpack/downloader/output | |
key: gf-downloader-resources | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v4 | |
- name: Setup Python Environment | |
run: | | |
cd unpack | |
pdm install | |
source .venv/bin/activate | |
pip install -r downloader/requirements.txt | |
- name: Download Resources | |
run: | | |
cd unpack | |
source .venv/bin/activate | |
mkdir -p downloader/resdata | |
cp gf-data-ch/resdata_no_hash.json downloader/resdata/ch_resdata.json | |
cd downloader | |
git apply ../downloader.patch | |
zip -j resdata.zip resdata/ch_resdata.json | |
python downloader.py --downloadres 0 --abname | |
- name: Cache Downloaded Resources | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
unpack/downloader/output | |
key: ${{ steps.restore-gf-downloader-resources.outputs.cache-primary-key }} | |
- name: Restore Cached Resources (images) | |
id: restore-image-resources | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
unpack/images | |
key: gf-image-resources | |
- name: Unpack images | |
run: | | |
cd unpack | |
source .venv/bin/activate | |
python tests/test_backgrounds.py | |
python tests/test_characters.py | |
- name: Cache Resources (images) | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
unpack/images | |
key: ${{ steps.restore-image-resources.outputs.cache-primary-key }} | |
- name: Restore Cached Resources (audio) | |
id: restore-audio-resources | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
unpack/audio | |
key: gf-audio-resources | |
- name: Unpack audio | |
run: | | |
cd unpack | |
source .venv/bin/activate | |
python tests/test_audio.py | |
- name: Cache Resources (audio) | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
unpack/audio | |
key: ${{ steps.restore-audio-resources.outputs.cache-primary-key }} | |
- name: Unpack resources | |
run: | | |
cd unpack | |
source .venv/bin/activate | |
python -m gfunpack downloader/output -o . | |
- name: Log Disk Space | |
run: df -h | |
- name: Move Resources | |
run: | | |
cd unpack | |
cp audio/audio.json images/backgrounds.json images/characters.json stories/stories.json stories/chapters.json ../src/assets | |
mv audio ../public | |
mv images ../public | |
mv stories ../public | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.4.0 | |
run_install: false | |
- name: Setup PNPM Workspace | |
run: | | |
pnpm install | |
- name: Build Site | |
run: | | |
pnpm build-index | |
pnpm build | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | |
directory: dist |