Skip to content

Add GitHub Actions workflow for GitHub Pages deployment#5

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-github-actions-workflow
Draft

Add GitHub Actions workflow for GitHub Pages deployment#5
Copilot wants to merge 2 commits into
mainfrom
copilot/add-github-actions-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 25, 2025

Adds a new workflow to build the Vite TypeScript app and deploy to GitHub Pages.

Changes

  • New .github/workflows/deploy-pages.yml workflow file
  • Triggers on push to main or master branches
  • Uses Node.js 18, builds with npm run build, deploys ./dist to GitHub Pages
  • Configures required permissions for Pages deployment (pages: write, id-token: write)

Workflow steps

- Checkout
- Setup Node.js 18
- npm ci
- npm run build
- Configure Pages
- Upload artifact (./dist)
- Deploy to GitHub Pages
Original prompt

Add a new GitHub Actions workflow file that builds the Vite TypeScript app and deploys it to GitHub Pages. Create a new branch and open a pull request against the repository's default branch (main).

Files to add:

  1. .github/workflows/deploy-pages.yml

Contents:
name: Build and Deploy (GitHub Pages)

on:
push:
branches: [ "main", "master" ]

permissions:
contents: read
pages: write
id-token: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
  - name: Checkout
    uses: actions/checkout@v4

  - name: Use Node.js
    uses: actions/setup-node@v4
    with:
      node-version: "18"

  - name: Install dependencies
    run: npm ci

  - name: Build
    run: npm run build

  - name: Configure Pages
    uses: actions/configure-pages@v3

  - name: Upload artifact for Pages
    uses: actions/upload-pages-artifact@v1
    with:
      path: ./dist

  - name: Deploy to GitHub Pages
    uses: actions/deploy-pages@v1

Notes:

  • Assumes Vite builds to ./dist. If your project uses a different build output directory, update the path in upload-pages-artifact.
  • Triggers on pushes to main/master. If you prefer a manual trigger or different branch, we can adjust.

This pull request was created as a result of the following prompt from Copilot chat.

Add a new GitHub Actions workflow file that builds the Vite TypeScript app and deploys it to GitHub Pages. Create a new branch and open a pull request against the repository's default branch (main).

Files to add:

  1. .github/workflows/deploy-pages.yml

Contents:
name: Build and Deploy (GitHub Pages)

on:
push:
branches: [ "main", "master" ]

permissions:
contents: read
pages: write
id-token: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
  - name: Checkout
    uses: actions/checkout@v4

  - name: Use Node.js
    uses: actions/setup-node@v4
    with:
      node-version: "18"

  - name: Install dependencies
    run: npm ci

  - name: Build
    run: npm run build

  - name: Configure Pages
    uses: actions/configure-pages@v3

  - name: Upload artifact for Pages
    uses: actions/upload-pages-artifact@v1
    with:
      path: ./dist

  - name: Deploy to GitHub Pages
    uses: actions/deploy-pages@v1

Notes:

  • Assumes Vite builds to ./dist. If your project uses a different build output directory, update the path in upload-pages-artifact.
  • Triggers on pushes to main/master. If you prefer a manual trigger or different branch, we can adjust.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 25, 2025
Co-authored-by: Grar00t <239743497+Grar00t@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for building and deploying Vite app Add GitHub Actions workflow for GitHub Pages deployment Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants