Skip to content

Commit 56e04e5

Browse files
committed
Added Github Action to build the site
1 parent 754dcec commit 56e04e5

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Deploy to GitHub Pages"
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: ["astro"]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Pages
25+
id: pages
26+
uses: actions/configure-pages@v5
27+
28+
- name: Install, build, and upload your site output
29+
uses: withastro/action@v4
30+
with:
31+
# path: . # The root location of your Astro project inside the repository. (optional)
32+
# node-version: 22 # The specific version of Node that should be used to build your site. Defaults to 22. (optional)
33+
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)
34+
build-cmd: |
35+
pnpm exec astro build \
36+
--site "${{ steps.pages.outputs.origin }}" \
37+
--base "${{ steps.pages.outputs.base_path }}"
38+
# pnpm run build # The command to run to build your site. Runs the package build script/task by default. (optional)
39+
40+
deploy:
41+
needs: build
42+
runs-on: ubuntu-latest
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)