Skip to content

Commit 2ece10b

Browse files
committed
official astro action
1 parent 2303340 commit 2ece10b

File tree

1 file changed

+21
-50
lines changed

1 file changed

+21
-50
lines changed

.github/workflows/astro.yml

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,43 @@
1-
# Sample workflow for building and deploying an Astro site to GitHub Pages
2-
#
3-
# To get started with Astro see: https://docs.astro.build/en/getting-started/
4-
#
5-
name: Deploy Astro site to Pages
1+
name: Deploy to GitHub Pages
62

73
on:
8-
# Runs on pushes targeting the default branch
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
96
push:
10-
branches: ["main"]
11-
12-
# Allows you to run this workflow manually from the Actions tab
7+
branches: [ main ]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
139
workflow_dispatch:
1410

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
# Allow this job to clone the repo and create a page deployment
1612
permissions:
1713
contents: read
1814
pages: write
1915
id-token: write
2016

21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23-
concurrency:
24-
group: "pages"
25-
cancel-in-progress: false
26-
27-
env:
28-
BUILD_PATH: "." # default value when not using subfolders
29-
# BUILD_PATH: subfolder
30-
3117
jobs:
3218
build:
33-
name: Build
3419
runs-on: ubuntu-latest
3520
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
38-
- name: Setup pnpm
39-
uses: pnpm/action-setup@v4
40-
with:
41-
version: 10.19
42-
- name: Setup Node
43-
uses: actions/setup-node@v4
44-
with:
45-
node-version: "20"
46-
cache: pnpm
47-
cache-dependency-path: ${{ env.BUILD_PATH }}/pnpm-lock.yaml
48-
- name: Setup Pages
49-
id: pages
50-
uses: actions/configure-pages@v5
51-
- name: Install dependencies
52-
run: pnpm install --frozen-lockfile
53-
working-directory: ${{ env.BUILD_PATH }}
54-
- name: Build with Astro
55-
run: pnpm astro build
56-
working-directory: ${{ env.BUILD_PATH }}
57-
- name: Upload artifact
58-
uses: actions/upload-pages-artifact@v3
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v5
23+
- name: Install, build, and upload your site
24+
uses: withastro/action@v5
5925
with:
60-
path: ${{ env.BUILD_PATH }}/dist
26+
package-manager: pnpm@latest
27+
# path: . # The root location of your Astro project inside the repository. (optional)
28+
# node-version: 24 # The specific version of Node that should be used to build your site. Defaults to 22. (optional)
29+
# 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)
30+
# build-cmd: pnpm run build # The command to run to build your site. Runs the package build script/task by default. (optional)
31+
# env:
32+
# PUBLIC_POKEAPI: 'https://pokeapi.co/api/v2' # Use single quotation marks for the variable value. (optional)
6133

6234
deploy:
63-
environment:
64-
name: github-pages
65-
url: https://hylo-lang.org
6635
needs: build
6736
runs-on: ubuntu-latest
68-
name: Deploy
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
6940
steps:
7041
- name: Deploy to GitHub Pages
7142
id: deployment
72-
uses: actions/deploy-pages@v4
43+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)