diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml new file mode 100644 index 0000000000..6529fa133f --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yml @@ -0,0 +1,34 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install dependencies + run: | + if [ -f package.json ]; then npm ci; fi + + - name: Build (if present) + run: | + if npm run | grep -q "build"; then npm run build || true; fi + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./static + keep_files: true