Skip to content

Commit 34a8a48

Browse files
committed
✨ feat(ci): add github actions workflow for deploying docs site
- added github actions workflow for deploying the documentation site to github pages - configured workflow to trigger on pushes to the `docs-site` branch and manual dispatch - included steps for checkout, build, and deployment using `withastro/action` and `actions/deploy-pages` - set up environment variables for github pages deployment 📦 chore(config): update astro config for github pages deployment - updated `astro.config.mjs` to include site and base configurations for github pages deployment - added `site` property pointing to the github pages url - added `base` property to specify the deployment directory
1 parent d8cd5bf commit 34a8a48

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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: [docs-site]
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+
- name: Install, build, and upload your site
24+
uses: withastro/action@v3
25+
# with:
26+
# path: . # The root location of your Astro project inside the repository. (optional)
27+
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
28+
# 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)
29+
30+
deploy:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
steps:
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// @ts-check
2-
import { defineConfig } from 'astro/config';
2+
import { defineConfig } from 'astro/config'
33

4-
import tailwindcss from '@tailwindcss/vite';
4+
import tailwindcss from '@tailwindcss/vite'
55

66
// https://astro.build/config
77
export default defineConfig({
8-
vite: {
9-
plugins: [tailwindcss()]
10-
}
11-
});
8+
vite: {
9+
plugins: [tailwindcss()],
10+
},
11+
site: 'https://devgauravjatt.github.io',
12+
base: 'drizzle-setup',
13+
})

0 commit comments

Comments
 (0)