Skip to content

Commit

Permalink
Merge pull request #1 from openedu101/workflows
Browse files Browse the repository at this point in the history
Workflows Deploy Fix Bugs
  • Loading branch information
terrancrypt authored Jul 17, 2024
2 parents 58f4605 + 9eb2a19 commit 0fc3d74
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
name: Deploy CI
name: Deploy Astro to Vercel

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

jobs:
deploy:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy to Vercel Action
uses: BetaHuhn/deploy-to-vercel-action@v1
- uses: actions/checkout@v3
with:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
fetch-depth: 0

- name: Clear Git cache and reset
run: |
git rm -rf --cached .
git reset --hard
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: List directory contents
run: |
echo "Contents of src/components:"
ls -la src/components/
- name: Build project
run: pnpm build

- name: Deploy to Vercel
if: github.event_name != 'pull_request'
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: |
npx vercel --prod --token=${{ secrets.VERCEL_TOKEN }} --yes
File renamed without changes.
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"jsx": "react-jsx",
"jsxImportSource": "react"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}

0 comments on commit 0fc3d74

Please sign in to comment.