• Stars
    star
    126
  • Rank 275,003 (Top 6 %)
  • Language
  • License
    Other
  • Created almost 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A GitHub Action that deploys your Astro project to GitHub Pages

Astro Deploy Action

This action for Astro builds your Astro project for GitHub Pages.

For more information, please see our complete deployment guide—Deploy your Astro Site to GitHub Pages.

Usage

Note: Want to get started even faster? Create a repository from our official GitHub Pages template!

Inputs

  • path - Optional: the root location of your Astro project inside the repository.
  • node-version - Optional: the specific version of Node that should be used to build your site. Defaults to 18.
  • package-manager - Optional: the Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. Accepted values: npm, yarn, pnpm, and bun. A version tag is also accepted, for example [email protected], pnpm@8, or bun@latest. If not provided, version will default to latest.

Example workflow:

Build and Deploy to GitHub Pages

Create a file at .github/workflows/deploy.yml with the following content.

name: Deploy to GitHub Pages

on:
  # Trigger the workflow every time you push to the `main` branch
  # Using a different branch name? Replace `main` with your branch’s name
  push:
    branches: [main]
  # Allows you to run this workflow manually from the Actions tab on GitHub.
  workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout your repository using git
        uses: actions/checkout@v4
      - name: Install, build, and upload your site output
        uses: withastro/action@v1
        # with:
            # path: . # The root location of your Astro project inside the repository. (optional)
            # node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
            # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v3

More Repositories

1

astro

The web framework for content-driven websites. ⭐️ Star to support our work!
TypeScript
41,861
star
2

starlight

🌟 Build beautiful, accessible, high-performance documentation websites with Astro
TypeScript
3,456
star
3

docs

Astro documentation
MDX
1,200
star
4

compiler

The Astro compiler. Written in Go. Distributed as WASM.
Go
430
star
5

prettier-plugin-astro

Prettier plugin for Astro
TypeScript
412
star
6

astro.build

MDX
320
star
7

houston.astro.build

Experimental AI assistant trained on the Astro docs
Astro
243
star
8

language-tools

Language tools for Astro
TypeScript
220
star
9

roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
218
star
10

blog-tutorial-demo

Astro
125
star
11

houston-vscode

Visual Studio Code theme featuring cool blues, minty greens, and soft purples
CSS
98
star
12

cli-kit

JavaScript
48
star
13

adapters

Home for Astro's core maintained adapters
TypeScript
34
star
14

astro.new

Astro
31
star
15

github-pages

Automatically deploy an Astro site to GitHub Pages
Astro
29
star
16

cli

The Pika CLI
TypeScript
24
star
17

astro-repl

TypeScript
24
star
18

wormhole

TypeScript
18
star
19

registry

The Pika Registry - more info coming soon... https://editor.pika.dev/
TypeScript
17
star
20

.github

Community health files for the @withastro organization
15
star
21

site-kit

Styles, components, and tooling config for use in *.astro.build websites
JavaScript
15
star
22

esnext-conf-2020

Pika Presents: ESNEXT CONF 2020
HTML
12
star
23

contribute.docs.astro.build

An entire Starlight site for the Astro Docs contributor guides.
MDX
11
star
24

view-transitions-demo

Astro
10
star
25

automation

Centralized repo for GitHub actions for the `withastro` org
10
star
26

houston-discord

TypeScript
9
star
27

studio-templates

Astro
7
star
28

astro-playground

TypeScript
6
star
29

ASTRO-E2

beep boop beep boop
JavaScript
5
star
30

astro-ecosystem-ci

Astro Ecosystem CI
TypeScript
5
star
31

astro-og-image

JavaScript
4
star
32

action-studio

TypeScript
3
star
33

withastro.github.io

HTML
2
star
34

templates

A mirror of the examples from the main monorepo
Astro
2
star