From 9a316f5dcb3f7ada9b311be58e91271f66fb4db3 Mon Sep 17 00:00:00 2001 From: Diego Marcos Segura Date: Mon, 16 Jun 2025 19:25:23 -0700 Subject: [PATCH] Automate site deployment --- .github/workflows/ci-deploy-site.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci-deploy-site.yml diff --git a/.github/workflows/ci-deploy-site.yml b/.github/workflows/ci-deploy-site.yml new file mode 100644 index 0000000..c46a32f --- /dev/null +++ b/.github/workflows/ci-deploy-site.yml @@ -0,0 +1,41 @@ +name: Deploy site + +on: + push: + branches: + - main # Or your default branch + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ['22.x'] + + - name: Install dependencies + run: npm install + + - name: Build Site + run: npm run site:build + + - name: Generate GitHub App token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + + - name: Deploy to site gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + external_repository: sparkjsdev/sparkjsdev.github.io + publish_branch: main + publish_dir: ./site + github_token: ${{ steps.generate-token.outputs.token }} + commit_message: "Deploy Spark site – ${{ github.sha }}"