Skip to content

Commit 4315193

Browse files
committed
[ci] initial setup for github pages build and deploy
1 parent 7113cc5 commit 4315193

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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:
8+
- main
9+
- 'ci-*'
10+
# Allows you to run this workflow manually from the Actions tab on GitHub.
11+
workflow_dispatch:
12+
13+
# Allow this job to clone the repo and create a page deployment
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout your repository using git
24+
uses: actions/checkout@v4
25+
- name: Install, build, and upload your site
26+
uses: withastro/action@v3
27+
# with:
28+
# path: . # The root location of your Astro project inside the repository. (optional)
29+
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
30+
# 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)
31+
# env:
32+
# PUBLIC_POKEAPI: 'https://pokeapi.co/api/v2' # Use single quotation marks for the variable value. (optional)
33+
34+
deploy:
35+
if: github.ref == 'refs/heads/main'
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)