diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..5f8b9a4 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,43 @@ +name: Build and Deploy Page + +on: + push: + branches: [ main ] + +jobs: + build-page: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip + + - name: Build HTML + run: | + ./build.sh + + - name: Upload page artifact for GitHub Pages + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + uses: actions/upload-pages-artifact@v3 + with: + path: build + + deploy-page: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + needs: build-page + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6bfb112..b4e88f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ cellar-editor cellar-generator -*.exe \ No newline at end of file +*.exe +build/ \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..15aa590 --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +set -e + +# build site generator itself +cd generator-cli +make -j8 +cd .. + +# copy assets outside of repo +rm -rf build +mkdir -p build + +cp -r authors build +cp -r genre build +cp -r roms build +cp -r tags build +cp -r templates build + +cp -r *.html build +cp -r *.ico build +cp -r *.css build +cp -r *.js build +cp -r *.png build +cp -r *.gif build + +find build/ -type f -name '*.z64' -delete +find build/ -type f -name '*.n64' -delete +find build/ -type f -name '*.v64' -delete +find build/ -type f -name '*.zip' -delete + +# build full website +cd build +../generator-cli/build/cellar-generator all +