name: Continuous Integration

on:
  push:
    branches:
      - main

# Add permissions block to grant write access
permissions:
  contents: write

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18
          registry-url: 'https://registry.npmjs.org/'
          always-auth: true

      - name: Install dependencies
        run: npm install

      - name: Run build
        run: npm run build
