Skip to content

Commit

Permalink
ci: adds initial CI/CD pipeline for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Oct 12, 2024
1 parent 7c45a1d commit da4f85f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy a Preview Site

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "latest"
- run: npm install -g pnpm
- run: pnpm install
- run: pnpm run generate
- run: |
mkdir -p dist/branches/${{ github.head_ref }}
mv .output/public/* dist/branches/${{ github.head_ref }}
- uses: actions/upload-pages-artifact@v3
with:
name: "Project Documentation - Branch (${{ github.head_ref }})"
path: "dist"
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: "Project Documentation - Branch (${{ github.head_ref }})"
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default defineNuxtConfig({
compatibilityDate: "2024-04-03",
css: ["~/assets/css/main.postcss"],
devtools: { enabled: true },
ssr: false,
modules: [
"nuxt-lucide-icons",
"@nuxt/content",
Expand All @@ -26,4 +27,4 @@ export default defineNuxtConfig({
linkExactActiveClass: "active",
},
},
});
});

0 comments on commit da4f85f

Please sign in to comment.