Skip to content

Commit

Permalink
ci: deploy template to vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
jojomatik authored Jan 6, 2024
1 parent 891484b commit 0698e1e
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion .github/workflows/template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build template
name: Build template and deploy to vercel
on: push

jobs:
Expand Down Expand Up @@ -30,3 +30,43 @@ jobs:
run: yarn build
- name: Lint
run: yarn lint

vercel_deploy:
name: Deploy template
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: jojomatik/nuxt-3-base
ref: build/nuxt-bundle
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Cache node modules
uses: actions/cache@v3
id: cache
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install correct version of nuxt-bundle
run: yarn add ${{ github.repository }}#${{ github.ref }}
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
env:
NITRO_PRESET: vercel-edge
- name: Deploy Project Artifacts to Vercel (Preview)
if: github.ref != 'refs/heads/main'
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel (Prod)
if: github.ref == 'refs/heads/main'
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 comments on commit 0698e1e

Please sign in to comment.