ci: update deploy github

This commit is contained in:
Alejandro Laguna
2025-08-25 19:44:50 +02:00
parent 2284eefae3
commit da6b5ba46e
2 changed files with 54 additions and 3 deletions

50
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Deploy Astro site to GitHub Pages
on:
push:
branches: ["main"]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
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@v4

View File

@@ -2,14 +2,15 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import astroIcon from "astro-icon" import astroIcon from "astro-icon"
import cloudflare from '@astrojs/cloudflare';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
vite: { plugins: [tailwindcss()], }, vite: { plugins: [tailwindcss()], },
integrations: [astroIcon()], integrations: [astroIcon()],
site: 'https://alejandrolaguna.dev',
base: "/",
output: "static",
server: { server: {
host: '0.0.0.0' host: '0.0.0.0',
}, },
adapter: cloudflare(),
}); });