|
1 |
| -name: Release & Production Deployment |
| 1 | +name: Vercel Production Deployment |
2 | 2 | env:
|
3 | 3 | VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
4 | 4 | VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
7 | 7 | branches:
|
8 | 8 | - master
|
9 | 9 | jobs:
|
10 |
| - release: |
11 |
| - runs-on: ubuntu-latest |
12 |
| - steps: |
13 |
| - - uses: actions/checkout@v2 |
14 |
| - with: |
15 |
| - fetch-depth: 0 |
16 |
| - - name: Setup Node.js |
17 |
| - uses: actions/setup-node@v3 |
18 |
| - with: |
19 |
| - registry-url: "https://registry.npmjs.org" |
20 |
| - - name: Install dependencies |
21 |
| - run: npm install |
22 |
| - - name: Setup Git user |
23 |
| - run: | |
24 |
| - git config user.name "${GITHUB_ACTOR}" |
25 |
| - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" |
26 |
| - - name: Show Git Status |
27 |
| - run: git status |
28 |
| - - name: Release with release-it |
29 |
| - run: | |
30 |
| - commit_message="${{ github.event.head_commit.message }}" |
31 |
| - if [[ "$commit_message" == *"[alpha]"* ]]; then |
32 |
| - npx release-it minor --preRelease=alpha --ci |
33 |
| - elif [[ "$commit_message" == *"[major-alpha]"* ]]; then |
34 |
| - npx release-it major --preRelease=alpha --ci |
35 |
| - else |
36 |
| - npx release-it --ci |
37 |
| - fi |
38 |
| - env: |
39 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
40 |
| - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 10 | + versioning: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + fetch-depth: 0 |
| 16 | + - name: Setup Node.js |
| 17 | + uses: actions/setup-node@v3 |
| 18 | + - name: Install dependencies |
| 19 | + run: npm install |
| 20 | + - name: Setup Git user |
| 21 | + run: | |
| 22 | + git config user.name "${GITHUB_ACTOR}" |
| 23 | + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" |
| 24 | + - name: Show Git Status |
| 25 | + run: git status |
| 26 | + - name: Release with release-it |
| 27 | + run: | |
| 28 | + commit_message="${{ github.event.head_commit.message }}" |
| 29 | + if [[ "$commit_message" == *"[alpha]"* ]]; then |
| 30 | + npx release-it minor --preRelease=alpha --ci |
| 31 | + else |
| 32 | + npx release-it --ci |
| 33 | + fi |
| 34 | + env: |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
41 | 36 | deploy:
|
| 37 | + needs: versioning |
42 | 38 | runs-on: ubuntu-latest
|
43 | 39 | steps:
|
44 | 40 | - uses: actions/checkout@v2
|
|
50 | 46 | run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
51 | 47 | - name: Deploy Project Artifacts to Vercel
|
52 | 48 | run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
| 49 | + release-npm: |
| 50 | + needs: deploy |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + # Setup .npmrc file to publish to npm |
| 55 | + - uses: actions/setup-node@v3 |
| 56 | + with: |
| 57 | + registry-url: 'https://registry.npmjs.org' |
| 58 | + - name: Install Deps |
| 59 | + run: npm install |
| 60 | + - name: Build |
| 61 | + run: npm run build |
| 62 | + - name: Release |
| 63 | + run: | |
| 64 | + commit_message="${{ github.event.head_commit.message }}" |
| 65 | + if [[ "$commit_message" == *"[alpha]"* ]]; then |
| 66 | + cd dist/bundle && npm publish --tag alpha --access public --non-interactive |
| 67 | + else |
| 68 | + cd dist/bundle && npm publish --access public --non-interactive |
| 69 | + fi |
| 70 | + env: |
| 71 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments