Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
devmatteini committed Jan 3, 2024
1 parent 6cbec1b commit 66f2380
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI/CD

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "**.md"

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install node 18.x
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"

- name: Install packages
run: npm ci

- name: Typecheck
run: npm run check

- name: Pull Vercel Environment Information
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: npm run ci:setup-vercel

- name: Build
run: npm run build

- name: Deploy to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: npm run ci:deploy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store
.vercel
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"check": "astro check",
"ci:setup-vercel": "vercel pull --yes --environment production --token \"$VERCEL_TOKEN\"",
"ci:deploy": "vercel deploy --prebuilt --prod --token \"$VERCEL_TOKEN\""
},
"dependencies": {
"@astrojs/check": "^0.3.4",
Expand Down

0 comments on commit 66f2380

Please sign in to comment.