|
1 |
| -name: Release |
| 1 | +name: Deploy to Netlify |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main # Change this if you're deploying from another branch |
5 | 7 |
|
6 | 8 | jobs:
|
7 |
| - release: |
8 |
| - name: Release |
| 9 | + deploy: |
9 | 10 | runs-on: ubuntu-latest
|
| 11 | + |
10 | 12 | steps:
|
11 |
| - - name: Checkout code |
12 |
| - uses: actions/checkout@v3 |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v4 |
13 | 15 |
|
14 |
| - - name: Setup Node.js |
15 |
| - uses: actions/setup-node@v3 |
| 16 | + - name: Install Node.js |
| 17 | + uses: actions/setup-node@v4 |
16 | 18 | with:
|
17 |
| - node-version: '20' |
18 |
| - cache: 'npm' |
| 19 | + node-version: 18 |
19 | 20 |
|
20 | 21 | - name: Install dependencies
|
21 |
| - run: npm install |
22 |
| - |
23 |
| - - name: Build library |
24 |
| - run: npm run build:ngverse |
| 22 | + run: npm install # Change this if using yarn or pnpm |
25 | 23 |
|
26 |
| - - name: Run semantic-release |
27 |
| - env: |
28 |
| - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
29 |
| - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
30 |
| - run: npm run semantic-release |
| 24 | + - name: Build the project |
| 25 | + run: npm run build:docs # Adjust according to your project |
31 | 26 |
|
32 |
| - - name: Trigger Vercel deployment |
33 |
| - if: success() # Run this step only if the previous steps succeeded |
34 |
| - env: |
35 |
| - DEPLOY_HOOK: ${{ secrets.VERCEL_PATH }} |
36 |
| - run: curl -X POST "$DEPLOY_HOOK" |
| 27 | + - name: Deploy to Netlify |
| 28 | + uses: nwtgck/actions-netlify@v2 |
| 29 | + with: |
| 30 | + publish-dir: './dist/docs/browser' # Change if your build output folder is different |
| 31 | + production-branch: main |
| 32 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + deploy-message: 'Deployed from GitHub Actions' |
| 34 | + netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
| 35 | + netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }} |
0 commit comments