Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
846 B
1
Indexable
Never
name: Build and Deploy

on:
  push:
    branches:
      - main

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    name: Build and Deploy
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      
      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 16 # Use the latest stable Node.js version
      
      - name: Install dependencies
        run: npm install
      
      - name: Build
        run: npm run build # Replace with your build command
      
      - name: Deploy to another branch
        uses: peaceiris/actions-gh-pages@v3
        with:
          publish_dir: ./build # The directory where your assets are generated
          publish_branch: build # The branch to push the assets to
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}